Print Working Directory, this shows the path you are currently working on
Change Directory, it can be a relative or absolute path (. is the directory itself and .. is the parent directory) Quick shotcuts
cd goes to your home directory
cd - goes to the last working directory
cd ~user_name goes to the home directory of that username
List contents of the directory
Determine file type, extensions in Linux does not necessarily determine the purpose of the file. This command shows a brief description of the file's content.
- Filenames and directory names are case sensitive
- Filenames starting with an period (.) are hidden
- Do not use special characters other than period, dash and underscore
Output truncate redirect
Output append redirect
Sort lines of text
Print lines matching a pattern
Output the first specified part of a file
Output the last specified part of a file
Input, Output and errors are actually sent to special files called stdin, stdout and stderr. But by default, output and errors are linked to the screen and input is attached to the keyboard.
We can redirect where output goes and where input comes from, and using that with pipelines, we can perform complex tasks.
The difference of redirection and pipeline is that pipeline sends output as input for another command, while redirection does this to files.
Clears the terminal screen
Display current time and date
Display a calendar of the current month
Manual for commands
Manipulating Files and Directories
-a Copy all attributes of the original file
-i Interactive mode (ask for confirmation), default is not ask
-r Recursive copy (required when copying entire directories)
-u Update, only overwrite if the copied files are newer
Move or rename files (original file ceases to exist)
Remove (delete) files and directories
-i Prompt for confirmation, it does not ask for default
-r Recursive remove files, required for directory
-f Force, ignore nonexistent files and do not prompt
Root directory, everything begins here
contains programs for the system to boot and run (commands in bash are here too)
System configuration files, and also shell scripts that run when the system boots. Important ones:
/etc/crontab - definition for automated jobs
/etc/passwd - list of user accounts
Home directories for users
Removable media mount points
The home directory for the root user
Large directory tree, contains all the program files for regular users
Directory for data that changes frequently
Help Us Go Positive!
We offset our carbon usage with Ecologi. Click the link below to help us!