Basic Linux Commands
Basic Linux Commands
Outline
➢
Very Basic Commands
➢
Working with Files
➢
File Redirection
➢
Getting Help
➢
File Permissions
➢
Links
➢
Editors
➢
Remote Login
2
Very Basic Commands
Listing Files and Directories
Creating Directories
Changing to a Different Directory
Path Names
Example
• $ pwd
8
Basic Linux Commands
Working with Files
Copying Files
Moving/renaming Files
Removing Files and Directories
Displaying Content of Files on Screen
Searching the contents of a file
• $ mv /home/IT CCI
- Move the file file1 from /home/IT directory to CCI directory
11
15
- Use the less command to display the content of the file and then type /
search string Example:
(search for the word localhost in the file /etc/hosts)
• $ less
/etc/hosts
/localhost
16
18
Example
• $ grep bash /etc/passwd | cut -d: -f1
19
20
21
22
23
25
26
Example:
• $ df /- Display the size and partitions of / directory
• $ df –s / - Display the size and partitions of / directory in
summary
27
28