Linux Commands
-
System reference manuals.
-
man
Options: <1, 2, 3, 4, 5, 6, 7, 8, 9>
Example 1: man man
Example 2: man 1 pwd
Example 3: man 2 strlen
-
-
Command to install package
-
apt-get (For Ubuntu)
Options: <install, update, upgrade>
Example: sudo apt-get install sl
-
yum or dnf (For Fedora/Redhat)
Options:
Example 1: sudo yum install sl
Example 2: sudo dnf install sl
-
-
Basic command for files or directory
-
touch
-
rm
options: <-i, -r>
-
cp
options: <-l, -a, -r, -f, -i, -v, --help>
-
mv
options: <-l, -a, -f, -i, -v, --help>
-
ln
options: <-s>
-
pwd
-
cd
options: < .., dir_path, /, ~/ >
-
ls
options: <-l, -t, -r, -h, -a, -R>
-
mkdir
options: <-p>
-
rmdir
options: <-r -f>
-
tree
options: <-d -f>
-
-
Command to view files
- cat
- head
- tail
- less
- more
-
Commands to check/modify file properties
-
file
-
stat
-
wc
options: <-c, -b, -l>
-
chmod
options: <+x>
-
chown
-
du
options: <-s, -h, -a>
-
-
Command to compare files/directory
- md5sum
- diff
- comm
- cmp
- meld
-
Comand to search/find a file
-
find
Example 1: To Find all executable file in a directory recursevely
find . -type f -executable
Example 2: To limit the search to current directory only
find . -maxdepth 1 -type f -executable
Example 3: To Find all executable file in a directory recursevely and remove it
find . -type f -executable | xargs rm
-
locate
-
which
-
whereis
-
-
Command to search/match-pattern inside file
- grep
-
Command for Disk and filesystem
-
df
options: <-h>
-
mount
-
unmount
-
fdisk
-
mkfs.ext3
-
mkfs.ext4
-
mkfs.vfat
-
mkfs.ntfs
-
-
Command to monitor system/process/user
-
uptime
-
uname
options: <-a -r>
-
whoami
-
ps
options: <-a -x>
-
top
-
pstree
-
kill
-
pkill
-
killall
-
-
Process scheduling command
- sleep
- watch
- renice
-
Command for system environmental variable
- env
- export
-
Command for networking
- ifconfig
- ping
- ssh
- scp
-
Compression and file packaging command
- tar
- zip
- unzip
- rar
-
Command to get Kernel Logs
-
dmesg
options: <-c>
-
-
Command to load/unload driver
- insmod
- rmmod
- modprobe
-
importent BASH variables
- PATH
- PWD
©2023-2024 rculock.com