Repository for advanced linux knowledge such as important commands, files etc.
Shows calendar
Shows file content
Changes directory
Quick Folders:
- ~ user's directory
- ~ myuser myuser's directory
- . current directory
- .. parent directory
Clears current terminal screen
Copies the file
Copies the directory
Shows system time
Prints string
Write string in file (no check for content, overwrites it)
Appends string to file content
Search for files in a directory hierarchy
Search for file in a directory hierarchy
Search for user's files in a directory
Search in file
Shows file content with moving features
Lists content of working directory
Options:
- -l long list
- -a shows hidden content
man command is used for information about commands.
Makes a directory with given name
Moves the file or directory
nano is a command line text editor
Prints working directory
Removes the directory
Removes the file
Removes the file forcely
Asks for removing file
Remove with child directories (recursive)
Creates a blank file
Shows the operating system name
Shows the detailed operating system information (eg. distribution, kernel version)
command1 | command2
Executes command1 then executes command2 with command1's output
command1 > file_name
Writes command1's output (stdout) into file_name (no check, overwrites it)
command1 >> file_name
Appends command1's output (stdout) into file_name
command1 2> file_name
Writes command1's error output (stderr) into file_name
command1 2>&1
Writes command1's error output (stderr) to stdout (prints on screen)
command1 < file_name
Send file_name to command1 as input (stdin)
Command line stream codes:
- 0 : stdin
- 1 : stdout
- 2 : stderr
/etc/resolv.conf -> System DNS servers
/etc/issue -> Distribution version
/etc/passwd -> Local users
/etc/shadow -> User password summaries
/etc/sudoers -> Sudo rules
/home/*/.bash_history -> User command history
/home/*/.ssh/id* -> SSH keys
/home/*/.vnc -> VNC remote access information
/ -> Root Directory
/bin -> User Binaries
/sbin -> System Binaries
/etc -> Configuration Files
/dev -> Device Files
/proc -> Process Information
/var -> Variable Files
/tmp -> Temporary Files
/usr -> User Programs
/home -> Home Directories
/boot -> Boot Loader Files
/lib -> System Libraries
/opt -> Optional add-on Apps
/mnt -> Mount Directory
/media -> Removable Devices
/srv -> Service Data
compress (extension .Z)
compress - compressing
uncompress - uncompressing
gzip (extension .gz)
gzip - compressing
gunzip - uncompressing
bzip2 (extension .bz2)
bzip2 - compressing
bunzip2 - uncompressing
tar -zcvf archive.tar.gz file1 file2
Explaining parameters
- -z for zip
- -c for create
- -v for verbose (graphical output)
- -f for file
tar -zxvf archive.tar.gz
-x parameter for extracting
tar -ztvf archive.tar.gz
-t parameter for list content
journalctl
command can be used for log informations.
Additional information can be found on journalctl manpage.