|
pwd
|
Print Working Directory, this shows the path you are currently working on
|
|
cd
|
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 |
|
ls
|
List contents of the directory
|
|
file
|
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.
|
|
#####
|
Operators
|
|
>
|
Output truncate redirect
|
|
>>
|
Output append redirect
|
|
2>
|
Error redirect
|
|
#####
|
Commands
|
|
cat
|
Concatenate
|
|
sort
|
Sort lines of text
|
|
grep
|
Print lines matching a pattern
|
|
head
|
Output the first specified part of a file
|
|
tail
|
Output the last specified part of a file
|
|
clear
|
Clears the terminal screen
|
|
date
|
Display current time and date
|
|
cal
|
Display a calendar of the current month
|
|
man
|
Manual for commands
|
|
cp
|
Copy files
-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 |
|
mv
|
Move or rename files (original file ceases to exist)
|
|
mkdir
|
Create directories
|
|
rm
|
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
|
|
/bin
|
contains programs for the system to boot and run (commands in bash are here too)
|
|
/dev
|
Devices mounted
|
|
/etc
|
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
|
Home directories for users
|
|
/lib
|
Shared libraries
|
|
/media
|
Removable media mount points
|
|
/root
|
The home directory for the root user
|
|
/tmp
|
Temporary files
|
|
/usr
|
Large directory tree, contains all the program files for regular users
|
|
/var
|
Directory for data that changes frequently
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.