Cheat sheet for the LinkedIN course about Linux Command Line
|
Command
|
Option(s)
|
Argument(s)
|
|
ls
|
-ahl
|
/usr/bin
|
|
sort
|
-u
|
users.txt
|
|
grep
|
-i "needle"
|
heystack
|
|
man
|
argument
|
|
argument
|
--help
|
|
apropos
|
functionality search
|
|
Tab
|
Tab completion
|
|
Ctrl - A
|
Move to beginning of line
|
|
Ctrl - E
|
Move to end of line
|
|
Ctrl - Left arrow
|
Move left one word
|
|
Ctrl - Rig arrow
|
Move right one word
|
|
Ctrl - U
|
Delete from cursor to line start
|
|
Ctrl - K
|
Delete from cursor to line end
|
|
Ctrl - Shift - C
|
Copy selected text to clipboard
|
|
Ctrl - Shift - V
|
Paste text from clipboard
|
|
Up arrow
|
Recall previous command
|
|
Down arrow
|
Scroll previous command
|
|
Ctrl - R
|
Search command history
|
|
Ctrl - C
|
Cancel command
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
file
|
argument
|
Determine file type
|
|
|
stat
|
argument
|
Display file status
|
|
/
|
File system root
|
|
/home
|
User home directories
|
|
/root
|
Root user's home directory
|
|
/etc
|
Common configuration files
|
|
/bin, /sbin
|
Common programs or commands
|
|
/lib
|
Shared libraries and modules
|
|
/mnt, /media
|
Standard location for mounting other file systems
|
|
/dev, /proc, /sys
|
Kernel and system information
|
|
/
|
Absolute path
|
|
.
|
Current working directory
|
|
..
|
Parent directory
|
|
~
|
Current user's home directory
|
|
\ - space
|
Equivalent to space key
|
|
cd
|
Change the shell working directory
|
|
pwd
|
Print the name of File system root: / User home directories: /home Root user's home directory: /root
|
|
ls
|
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
cd
|
available
|
new directory
|
Change the shell working directory
|
|
pwd
|
available
|
Print the name of the current working directory
|
|
|
ls
|
-lh
|
directory
|
List information about the files
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
mkdir
|
available
|
directory(ies)
|
Create the directory(ies)Create the directory(ies)
|
|
rmdir
|
available
|
directory(ies)
|
Remove the directory(ies), if they are empty
|
|
cp
|
available
|
source - destination
|
Copy source to destination
|
|
mv
|
available
|
source - destination
|
Move source to destination
|
|
rm
|
-r
|
file(s)
|
Remove the file(s) (recursively)
|
|
find
|
-name
|
directory - "expression*?
|
Find directory or file by name
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
grep
|
options
|
"pattern*? file name
|
Search for patterns in file
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
cat
|
available
|
file name
|
Concatenate to standard output
|
|
head
|
available
|
file name
|
Print the first number of something
|
|
tail
|
available
|
file name
|
Print the last number of something
|
|
Command
|
Description
|
|
awk
|
Often used to extract specific text from a file according to rule
|
|
sed
|
Often used to modify text in a command pipeline or in place
|
|
sort
|
Often used to sort text
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
ln
|
-s
|
source file link name
|
Creates a soft link
|
|
ln
|
source file link name
|
Creates a hard link
|
|
User
|
Group
|
Others
|
Description
|
|
rwx
|
rwx
|
rwx
|
Up to three letters indicate the permissions for the file or directory
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
chmod
|
octal or symbolic change
|
file or directory
|
Changes the mode of the file or directory
|
|
chown
|
new owner
|
file or directory
|
Changes the owner of the file or directory
|
|
chgrp
|
new group
|
file or directory
|
Changes the group of the file or directory
|
|
Command
|
Option(s)
|
Argument(s)
|
Description
|
|
tar
|
-cvf
|
file name.tar directory
|
Creates a tape archive
|
|
tar
|
-caf
|
file name.tar.gz/tar.bz2 directory
|
Creates a compressed tape archive, the compression type depends on the extension
|
|
tar
|
-xf
|
file name -C target directory
|
Extracts a compressed tape archive inside a certain directory
|
|
zip
|
-r
|
file name directory to compress
|
Compresses a directory
|
|
unzip
|
file name -d target directory
|
Extracts a directory
|
|
sudo + command
|
Executes the command with superuser rights (requires user password)
|
|
sudo + -s
|
Activates superuser rights for a period of time
|
|
sudo + -k
|
Gives up superuser rights
|
|
env
|
Set some attributes in the environment
|
|
which
|
Locate a command
|
|
~/.bash_profile
|
Bash profile (create with command nano)
|
|
Stream
|
Number
|
Usage
|
|
|
Standard Input (stdin)
|
0
|
Text input
|
|
|
Standard Output (stdout)
|
1
|
Text output
|
|
|
Standard Error (stderr)
|
2
|
Error text
|
|
|
command
|
number>
|
file name
|
Redirects the output to the file
|
|
command
|
number>>
|
file name
|
Appends the output to the file
|
|
Command
|
Description
|
|
ls -l /etc/*release
|
List of the files that contain information about the release
|
|
cat /etc/*release
|
Shows information about the two files in the release folder
|
|
uname -a
|
Show information about Linux Kernel
|
|
uname -r
|
Shows only the version of the Linux Kernel
|
|
free -h
|
Shows how much memory the system has
|
|
cat /proc/cpuinfo
|
Shows how much CPU the system has
|
|
lscpu
|
Shows more comprehensive information about the system's CPU
|
|
df -h
|
Shows how much storage the system has
|
|
apt search search
|
Looks for packages whose description match the search term
|
|
apt show package
|
Displays information about the package
|
|
sudo apt update
|
Retrieve an updated list of the packages from the repositories before installing new software or upgrading the software package
|
|
sudo apt install package
|
Install the package
|
|
sudo apt upgrade
|
Upgrade the software package
|
No comments yet.
Cheatography n. The art of mapping complex subjects into clear, instantly navigable reference guides.