A complete list of common Linux commands,
Tips: Ctrl+F to quickly find Linux commands (click the title to shrink and expand)
command code | Notes |
---|---|
arch | Display the processor architecture of the machine (1) |
uname -m | Display the processor architecture of the machine (2) |
uname -r | Display the kernel version in use |
dmidecode -q | Display Hardware System Components - (SMBIOS / DMI) |
hdparm -i /dev/hda | List the architectural properties of a disk |
hdparm -tT /dev/sda | Perform a test read on disk |
cat /proc/cpuinfo | Display CPU info information |
cat /proc/interrupts | Display Interrupt |
cat /proc/meminfo | Check memory usage |
cat /proc/swaps | Show which swap is used |
cat /proc/version | Show kernel version |
cat /proc/net/dev | Show network adapters and statistics |
cat /proc/mounts | Show mounted filesystems |
lspci -tv | List PCI devices |
lsusb -tv | Show usb devices |
date | Display system date |
cal 2007 | Display the calendar for 2007 |
date 041217002007.00 | Set date and time - month day hour minute year.second |
clock -w | Save time changes to BIOS |
command code | Notes |
---|---|
shutdown -h now | Shut down the system |
init 0 | Shut down the system |
telinit 0 | Shut down the system |
shutdown -h hours:minutes & | Shut down the system at a scheduled time |
shutdown -c | Cancel shutting down the system at a scheduled time |
shutdown -r now | Restart |
reboot | Restart |
logout | Logout |
command code | Notes |
---|---|
cd /home | Enter the '/home' directory' |
cd .. | Back to the previous directory |
cd ../.. | Back to the previous two levels of directory |
cd | Enter your home directory |
cd ~user1 | Enter your home directory |
cd - | Return to last directory |
pwd | Show working path |
ls | View files in directory |
ls -F | View files in directory |
ls -l | Display file and directory details |
ls -a | Show hidden files |
ls *[0-9]* | Display file and directory names containing numbers |
tree | Display the tree structure of files and directories starting from the root directory |
lstree | Display the tree structure of files and directories starting from the root directory |
mkdir dir1 | Create a directory called 'dir1' |
mkdir dir1 dir2 | Create two directories at the same time |
mkdir -p /tmp/dir1/dir2 | Create a directory tree |
rm -f file1 | Deleting a file called 'file1'' |
rmdir dir1 | Delete a directory called 'dir1' |
rm -rf dir1 | Delete a directory called 'dir1' and its contents |
rm -rf dir1 dir2 | Delete both directories and their contents at the same time |
mv dir1 new_dir | Rename/move a directory |
cp file1 file2 | Copy a file |
cp dir/* . | Copy all files in a directory to the current working directory |
cp -a /tmp/dir1 . | Copy a directory to the current working directory |
cp -a dir1 dir2 | Copy a directory |
ln -s file1 lnk1 | Create a soft link to a file or directory |
ln file1 lnk1 | Create a physical link to a file or directory |
touch -t 0712250000 file1 | Modify a file or directory timestamp - (YYMMDDhhmm) |
iconv -l | List known encodings |
iconv -f fromEncoding -t toEncoding inputFile > outputFile | Change character encoding |
find . -maxdepth 1 -name *.jpg -print -exec convert | Batch resize files in the current directory and send them to the thumbnail directory (requires conversion from ImageMagick) |
command code | Notes |
---|---|
find / -name file1 | Start from '/' to enter the root file system to search for files and directories |
find / -user user1 | Search for files and directories belonging to user 'user1' |
find /home/user1 -name \*.bin | Search for files ending with '.bin' in directory '/home/user1' |
find /usr/bin -type f -atime +100 | Search for executable files that have not been used in the past 100 days |
find /usr/bin -type f -mtime -10 | Search for files that were created or modified within 10 days |
find / -name \*.rpm -exec chmod 755 '{}' \; | Search for files ending in '.rpm' and define their permissions |
find / -xdev -name \*.rpm | Search for files ending with '.rpm', ignoring removable devices such as CD-ROMs and shortcuts |
locate \*.ps | Look for files ending in '.ps' - run 'updatedb' first |
where is halt | Display the location of a binary, source or man |
which halt | Display the full path to a binary or executable |
command code | Notes |
---|---|
mount /dev/hda2 /mnt/hda2 | Mount a disk called hda2 - make sure the directory '/mnt/hda2' already exists |
umount /dev/hda2 | Unmount a disk called hda2 - first exit from the mount point '/mnt/hda2' |
fuser -km /mnt/hda2 | Force unmount when device is busy |
umount -n /mnt/hda2 | Run the unmount without writing to the /etc/mtab file - useful when the file is read-only or when the disk is full |
mount /dev/fd0 /mnt/floppy | Mount a floppy |
mount /dev/cdrom /mnt/cdrom | Mount a cdrom or dvdrom |
mount /dev/hdc /mnt/cdrecorder | Mount a cdrw or dvdrom |
mount /dev/hdb /mnt/cdrecorder | Mount a cdrw or dvdrom |
mount -o loop file.iso /mnt/cdrom | Mount a file or ISO image |
mount -t vfat /dev/hda5 /mnt/hda5 | Mount a Windows FAT32 filesystem |
mount /dev/sda1 /mnt/usbdisk | Mount a usb stick or flash drive |
mount -t smbfs -o username=user,password=pass //WinClient/share /mnt/share | Mount a windows network share |
command code | Notes |
---|---|
df -h | Display the list of mounted partitions |
ls -lSr |more | Arrange files and directories by size |
du -sh dir1 | Estimated disk space used by directory 'dir1'' |
du -sk * | sort -rn | Display the size of files and directories in sequence based on the size of the capacity |
rpm -q -a --qf '%10{SIZE}t%{NAME}n' | sort -k1,1n | Display the space used by the installed rpm packages according to the size (fedora, redhat-like systems) |
dpkg-query -W -f='${Installed-Size;10}t${Package}n' | sort -k1,1n | Display the space used by installed deb packages by size (ubuntu, debian-like systems) |
command code | Notes |
---|---|
groupadd group_name | Create a new user group |
groupdel group_name | Delete a user group |
groupmod -n new_group_name old_group_name | Rename a usergroup |
useradd -c "Name Surname " -g admin -d /home/user1 -s /bin/bash user1 | Create a user belonging to the "admin" usergroup |
useradd user1 | Create a new user |
userdel -r user1 | Remove a user ('-r' exclude home directory) |
usermod -c "User FTP" -g system -d /ftp/user1 -s /bin/nologin user1 | Modify user attributes |
passwd | Change password |
passwd user1 | Change a user's password (only root execution is allowed) |
chage -E 2020-12-31 user1 | Set user password expiration date |
pwck | Check '/etc/passwd' for file format and syntax corrections and existing users |
grpck | Check '/etc/passwd' for file format and syntax corrections and existing groups |
newgrp group_name | Log in to a new group to change the default group for newly created files |
command code | Notes |
---|---|
ls -lh | Show Permissions |
ls /tmp | pr -T5 -W$COLUMNS | Divide the terminal into 5 columns for display |
chmod ugo+rwx directory1 | Set the owner (u), group (g) and others (o) permissions of the directory to read (r), write (w) and execute (x) permissions |
chmod go-rwx directory1 | Delete group (g) and others (o) permissions to read, write, and execute directories |
chown user1 file1 | Change the owner attribute of a file |
chown -R user1 directory1 | Change the owner attribute of a directory and change the attributes of all files in the directory at the same time |
chgrp group1 file1 | Change the group of the file |
chown user1:group1 file1 | Change the owner and group attributes of a file |
find / -perm -u+s | List all files controlled by SUID in a system |
chmod u+s /bin/file1 | Set the SUID bit of a binary - the user who runs the file is given the same permissions as the owner |
chmod u-s /bin/file1 | Disable the SUID bit for a binary |
chmod g+s /home/public | Set the SGID bit of a directory - like SUID, but for directories |
chmod g-s /home/public | Disable the SGID bit for a directory |
chmod o+t /home/public | Set the STIKY bit on a file - only allow the rightful owner to delete the file |
chmod o -t /home/public | Disable the STIKY bit for a directory |
command code | Notes |
---|---|
chattr +a file1 | Only allow reading and writing files in append mode |
chattr +c file1 | Allow this file to be automatically compressed/decompressed by the kernel |
chattr +d file1 | The dump program will ignore this file when doing a file system backup |
chattr +i file1 | Set as an immutable file and cannot be deleted, modified, renamed or linked |
chattr +s file1 | Allows a file to be safely deleted |
chattr +S file1 | Once the application program writes to this file, the system immediately writes the modified results to disk |
chattr +u file1 | If the file is deleted, the system will allow you to restore the deleted file in the future |
lsattr | Display special attributes |
command code | Notes |
---|---|
bunzip2 file1.bz2 | Unzip a file called 'file1.bz2' |
bzip2 file1 | Compress a file called 'file1' |
gunzip file1.gz | Decompress a file called 'file1.gz' |
gzip file1 | Compress a file called 'file1' |
gzip -9 file1 | Maximum compression |
rar a file1.rar test_file | Create a package called 'file1.rar' |
rar a file1.rar file1 file2 dir1 | Compress 'file1', 'file2' and directory 'dir1' at the same time |
rar x file1.rar | Decompress the rar package |
unrar x file1.rar | Decompress the rar package |
tar -cvf archive.tar file1 | Create an uncompressed tarball |
tar -cvf archive.tar file1 file2 dir1 | Create an archive containing 'file1', 'file2' and 'dir1' |
tar -tf archive.tar | Display the contents of a package |
tar -xvf archive.tar | Release a package |
tar -xvf archive.tar -C /tmp | Release the compressed package to the /tmp directory |
tar -cvfj archive.tar.bz2 dir1 | Create a compressed package in bzip2 format |
tar -jxvf archive.tar.bz2 | Decompress a compressed package in bzip2 format |
tar -cvfz archive.tar.gz dir1 | Create a compressed package in gzip format |
tar -zxvf archive.tar.gz | Decompress a compressed package in gzip format |
zip file1.zip file1 | Create a compressed package in zip format |
zip -r file1.zip file1 file2 dir1 | Compress several files and directories into a compressed package in zip format |
unzip file1.zip | Decompress a zip file |
command code | Notes |
---|---|
rpm -ivh package.rpm | Install an rpm package |
rpm -ivh --nodeeps package.rpm | Install an rpm package ignoring dependency warnings |
rpm -U package.rpm | Update an rpm package without changing its configuration file |
rpm -F package.rpm | Update a confirmed installed rpm package |
rpm -e package_name.rpm | Delete an rpm package |
rpm -qa | Display all installed rpm packages in the system |
rpm -qa | grep httpd | Show all rpm packages with "httpd" in their name |
rpm -qi package_name | Get special information about an installed package |
rpm -qg "System Environment/Daemons" | Display the rpm package of a component |
rpm -ql package_name | Display a list of files provided by an installed rpm package |
rpm -qc package_name | Display a list of configuration files provided by an installed rpm package |
rpm -q package_name --whatrequires | Show a list of dependencies with an rpm package |
rpm -q package_name --whatprovides | Display the volume occupied by an rpm package |
rpm -q package_name --scripts | Show scripts executed during install/remove |
rpm -q package_name --changelog | Display the modification history of an rpm package |
rpm -qf /etc/httpd/conf/httpd.conf | Confirm which rpm package provides the given file |
rpm -qp package.rpm -l | Show a list of files provided by an rpm package that has not been installed |
rpm --import /media/cdrom/RPM-GPG-KEY | Import public key digital certificate |
rpm --checksig package.rpm | Confirm the integrity of an rpm package |
rpm -qa gpg-pubkey | Confirm the integrity of all installed rpm packages |
rpm -V package_name | Check file size, permission, type, owner, group, MD5 check and last modified time |
rpm -Va | Check all installed rpm packages on the system - use with care |
rpm -Vp package.rpm | Confirm that an rpm package has not been installed |
rpm2cpio package.rpm | cpio --extract --make-directories *bin* | Run an executable from an rpm package |
rpm -ivh /usr/src/redhat/RPMS/`arch`/package.rpm | Install a built package from an rpm source |
rpmbuild --rebuild package_name.src.rpm | Build an rpm package from an rpm source |
command code | Notes |
---|---|
yum install package_name | Download and install an rpm package |
yum localinstall package_name.rpm | A rpm package will be installed, using your own repositories to resolve all dependencies for you |
yum update package_name.rpm | Update all rpm packages installed in the current system |
yum update package_name | Update an rpm package |
yum remove package_name | Delete an rpm package |
yum list | List all packages installed on the current system |
yum search package_name | Search for packages in rpm repositories |
yum clean packages | Clean up rpm cache and delete downloaded packages |
yum clean headers | Remove all header files |
yum clean all | Delete all cached packages and headers |
command code | Notes |
---|---|
dpkg -i package.deb | Install/update a deb package |
dpkg -r package_name | Delete a deb package from the system |
dpkg -l | Display all deb packages installed in the system |
dpkg -l | grep httpd | Show all deb packages with "httpd" in their name |
dpkg -s package_name | Get information about a particular package already installed on the system |
dpkg -L package_name | Display the list of files provided by a deb package already installed in the system |
dpkg --contents package.deb | Display a list of files provided by a package that is not yet installed |
dpkg -S /bin/ping | Confirm which deb package provides the given file |
command code | Notes |
---|---|
apt-get install package_name | Install/update a deb package |
apt-cdrom install package_name | Install/update a deb package from CD |
apt-get update | Update packages in the list |
apt-get upgrade | Upgrade all installed software |
apt-get remove package_name | Delete a deb package from the system |
apt-get check | Confirm that the dependent software warehouse is correct |
apt-get clean | Clean cache from downloaded packages |
apt-cache search searched-package | Return the package names containing the search string |
command code | Notes |
---|---|
cat file1 | View the content of the file forward from the first byte |
tac file1 | View the contents of a file in reverse from the last line |
more file1 | View the contents of a long file |
less file1 | Similar to the 'more' command, but it allows reverse operations in files as well as forward operations |
head -2 file1 | View the first two lines of a file |
tail -2 file1 | View the last two lines of a file |
tail -f /var/log/messages | Live view of content being added to a file |
command code | Notes |
---|---|
cat file1 | command( sed, grep, awk, grep, etc...) > result.txt | Merge the detailed description text of a file and write the introduction into a new file |
cat file1 | command( sed, grep, awk, grep, etc...) >> result.txt | Merge the detailed description text of a file and write the introduction into an existing file |
grep Aug /var/log/messages | Find keyword "Aug" in file '/var/log/messages' |
grep ^Aug /var/log/messages | Find words starting with "Aug" in file '/var/log/messages' |
grep [0-9] /var/log/messages | Select all lines containing numbers in the '/var/log/messages' file |
grep Aug -R /var/log/* | Search for the string "Aug" in the directory '/var/log' and subsequent directories |
sed 's/stringa1/stringa2/g' example.txt | Replace "string1" in the example.txt file with "string2" |
sed '/^$/d' example.txt | Remove all blank lines from the example.txt file |
sed '/ *#/d; /^$/d' example.txt from example.txt | Remove all comments and blank lines from the file |
echo 'esempio' | tr '[:lower:]' '[:upper:]' | Merge upper and lower cell contents |
sed -e '1d' result.txt | Exclude the first line from the file example.txt |
sed -n '/stringa1/p' | View lines that only contain the word "string1" |
sed -e 's/ *$//' example.txt | Delete whitespace at the end of each line |
sed -e 's/stringa1//g' example.txt | Remove only the term "string1" from the document and keep the rest |
sed -n '1,5p;5q' example.txt | View the content from the first line to the fifth line |
sed -n '5p;5q' example.txt | View line 5 |
sed -e 's/00*/0/g' example.txt | Replace multiple zeros with a single zero |
cat -n file1 | Indicates the number of lines in the file |
cat example.txt | awk 'NR%2==1' | Delete all even lines in the example.txt file |
echo a b c | awk '{print $1}' | View the first column of a row |
echo a b c | awk '{print $1,$3}' | View the first and third columns of a row |
paste file1 file2 | Merge the contents of two files or two columns |
paste -d '+' file1 file2 | Merge the contents of two files or two columns, separated by "+" in the middle |
sort file1 file2 | Sort the contents of the two files |
sort file1 file2 | uniq | Take out the union of two files (only keep one duplicate line) |
sort file1 file2 | uniq -u | Delete intersection, leaving other rows |
sort file1 file2 | uniq -d | Take out the intersection of two files (leaving only files that exist in both files) |
comm -1 file1 file2 | Compare the contents of two files and delete only the content contained in 'file1' |
comm -2 file1 file2 | Compare the contents of two files and delete only the contents contained in 'file2' |
comm -3 file1 file2 | Comparing the contents of two files deletes only the parts common to both files |
command code | Notes |
---|---|
dos2unix filedos.txt fileunix.txt | Convert the format of a text file from MSDOS to UNIX |
unix2dos fileunix.txt filedos.txt | Convert a text file format from UNIX to MSDOS |
recode ..HTML
|
Convert a text file to html |
recode -l | more | Show all allowed conversion formats |
command code | Notes |
---|---|
badblocks -v /dev/hda1 | Check for bad blocks on disk hda1 |
fsck /dev/hda1 | Repair/check integrity of linux filesystem on disk hda1 |
fsck.ext2 /dev/hda1 | Repair/check integrity of ext2 filesystem on disk hda1 |
e2fsck /dev/hda1 | Repair/check integrity of ext2 filesystem on disk hda1 |
e2fsck -j /dev/hda1 | Repair/check integrity of ext3 filesystem on disk hda1 |
fsck.ext3 /dev/hda1 | Repair/check integrity of ext3 filesystem on disk hda1 |
fsck.vfat /dev/hda1 | Repair/check the integrity of the fat filesystem on the hda1 disk |
fsck.msdos /dev/hda1 | Repair/check integrity of dos filesystem on disk hda1 |
dosfsck /dev/hda1 | Repair/check integrity of dos filesystem on disk hda1 |
command code | Notes |
---|---|
mkfs /dev/hda1 | Create a file system on the hda1 partition |
mke2fs /dev/hda1 | Create a linux ext2 file system in the hda1 partition |
mke2fs -j /dev/hda1 | Create a linux ext3 (journal) file system in the hda1 partition |
mkfs -t vfat 32 -F /dev/hda1 | Create a FAT32 filesystem |
fdformat -n /dev/fd0 | Format a floppy disk |
mkswap /dev/hda3 | Create a swap filesystem |
command code | Notes |
---|---|
mkswap /dev/hda3 | Create a swap filesystem |
swapon /dev/hda3 | Enable a new swap filesystem |
swapon /dev/hda2 /dev/hdb3 | Enable two swap partitions |
command code | Notes |
---|---|
dump -0aj -f /tmp/home0.bak /home | Make a full backup of the '/home' directory |
dump -1aj -f /tmp/home0.bak /home | Make an interactive backup of the '/home' directory |
restore -if /tmp/home0.bak | Restore an interactive backup |
rsync -rogpav --delete /home /tmp | Synchronize directories on both sides |
rsync -rogpav -e ssh --delete /home ip_address:/tmp | rsync via SSH tunnel |
rsync -az -e ssh --delete ip_addr:/home/public /home/local | Synchronize a remote directory to a local directory via ssh and zip |
rsync -az -e ssh --delete /home/local ip_addr:/home/public | Synchronize local directory to remote directory via ssh and compression |
dd bs=1M if=/dev/hda | gzip | ssh user@ip_addr 'dd of=hda.gz' | Execute an operation of backing up the local disk on the remote host through ssh |
dd if=/dev/sda of=/tmp/file1 | Back up disk contents to a file |
tar -Puf backup.tar /home/user | Perform an interactive backup of the '/home/user' directory |
( cd /tmp/local/ && tar c . ) | ssh -C user@ip_addr 'cd /home/share/ && tar x -p' | Copy a directory content in a remote directory via ssh |
( tar c /home ) | ssh -C user@ip_addr 'cd /home/backup-home && tar x -p' | Copy a local directory in a remote directory via ssh |
tar cf - . | (cd /tmp/backup ; tar xf - ) | Copy a directory to another place locally, retaining the original permissions and links |
find /home/user1 -name '*.txt' | xargs cp -av --target-directory=/home/backup/ --parents | Find and copy all files ending with '.txt' from one directory to another |
find /var/log -name '*.log' | tar cv --files-from=- | bzip2 > log.tar.bz2 | Find all files ending with '.log' and make a bzip package |
dd if=/dev/hda of=/dev/fd0 bs=512 count=1 | Do an action to copy the content of MBR (Master Boot Record) to floppy disk |
dd if=/dev/fd0 of=/dev/hda bs=512 count=1 | Restore MBR contents from a backup that has been saved to a floppy disk |
command code | Notes |
---|---|
cdrecord -v gracetime=2 dev=/dev/cdrom -eject blank=fast -force | Empty a rewritable disc |
mkisofs /dev/cdrom > cd.iso | Create an iso image file of the CD on disk |
mkisofs /dev/cdrom | gzip > cd_iso.gz | Create a compressed disc iso image file on disk |
mkisofs -J -allow-leading-dots -R -V "Label CD" -iso-level 4 -o ./cd.iso data_cd | Create an iso image file of a directory |
cdrecord -v dev=/dev/cdrom cd.iso | Burn an ISO image |
gzip -dc cd_iso.gz | cdrecord dev=/dev/cdrom - | Burn a compressed ISO image |
mount -o loop cd.iso /mnt/iso | Mount an ISO image file |
cd-paranoia -B | Rip tracks from a CD to wav files |
cd-paranoia -- "-3" | Rip tracks from a CD to wav files (parameter -3) |
cdrecord --scanbus | Scan the bus to identify scsi channels |
dd if=/dev/hdc | md5sum | Verify the md5sum encoding of a device, such as a CD |
command code | Notes |
---|---|
dhclient eth0 | Enable the 'eth0' network device in dhcp mode |
ethtool eth0 | Display the traffic statistics of network card 'eth0' |
host www.example.com | Look up hostnames to resolve names and IP addresses and mirrors |
hostname | Display hostname |
ifconfig eth0 | Display the configuration of an ethernet card |
ifconfig eth0 192.168.1.1 netmask 255.255.255.0 | Control IP address |
ifconfig eth0 promisc | Set 'eth0' to promiscuous mode to sniff packets (sniffing) |
ifdown eth0 | Disable an 'eth0' network device |
ifup eth0 | Enable an 'eth0' network device |
ip link show | Display the connection status of all network devices |
iwconfig eth1 | Display the configuration of a wireless network card |
iwlist scan | Show wireless networks |
mii-tool eth0 | Display the connection status of 'eth0' |
netstat -tup | Display all enabled network connections and their PIDs |
netstat -tup1 | Display all listening network services and their PIDs |
netstat -rn | Display the routing table, similar to the "route -n" command |
nslookup www.example.com | Look up hostnames to resolve names and IP addresses and mirrors |
route -n | Show routing table |
route add -net 0/0 gw IP Gateway | Control Default Gateway |
route add -net 192.168.0.0 netmask 255.255.0.0 gw 192.168.1.1 | Control static route to network '192.168.0.0/16' |
route del 0/0 gw IP gateway | Delete static route |
echo "1"> /proc/sys/net/ipv4/ip_foward | Activate IP forwarding |
tcpdump tcp port 80 | Show all HTTP loopbacks |
whois www.example.com | Lookup in Whois database |
command code | Notes |
---|---|
mount -t smbfs -o username=user,password=pass //WinClient/share/mnt/share | Mount a windows network share |
nbtscan ip addr | netbios name resolution |
nmblookup -A ip addr | netbios name resolution |
smbclient -L ip addr/hostname | Display remote shares of a windows host |
smbget -Rr smb://ip addr/share | Ability to download files from a windows host via smb like wget |
command code | Notes |
---|---|
iptables -t filter -L | Show all links in the filter table |
iptables -t nae -L | Display all links of nat table |
iptables -t filter -F | Clear all rules based on the filter table |
iptables -t nat -F | Clear all rules based on nat table |
iptables -t filter -X | Delete all user-created links |
iptables -t filter -A INPUT -p tcp --dport telnet -j ACCEPT | Allow telnet access |
iptables -t filter -A OUTPUT -p tcp --dport telnet -j DROP | Block telnet access |
iptables -t filter -A FORWARD -p tcp --dport pop3 -j ACCEPT | Allow POP3 connections on the forwarding link |
iptables -t filter -A INPUT -j LOG --log-prefix | Record all packets blocked in the link |
iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE | Set up a PAT (port address translation) to mask outgoing packets on eth0 |
iptables -t nat -A POSTROUTING -d 192.168.0.1 -p tcp -m tcp --dport 22-j DNAT --to-destination 10.0.0.2:22 | Redirect packets destined for one host address to other hosts |
command code | Notes |
---|---|
free -m | List RAM status in megabytes |
kill -9 process id | Forcibly close the process and end it |
kill -1 process id | Force a process to reload its configuration |
last reboot | Show reboot history |
lsmod | List the status of kernel modules |
lsof -p process id | List a list of files opened by the process |
lsof /home/user1 | List the open files in the given system directory |
ps -eafw | List linux tasks |
ps -e -o pid,args --forest | List linux tasks in a hierarchical manner |
pstress | Display programs in a tree view |
smartctl -A /dev/hda | Monitor hard disk device reliability by enabling SMART |
smartctl -i /dev/hda | Check if SMART of a hard disk device is enabled |
strace -c ls >/dev/null | List system calls made and receive with one process |
strace -f -e open ls >/dev/null | List library calls |
tail /var/log/dmesg | Display internal events during kernel boot |
tail /val/log/messages | Show system events |
top | List the linux tasks that use the most CPU resources |
watch -nl 'cat /proc/interrupts' | List real-time interrupts |
command code | Notes |
---|---|
alias hh='history' | Set an alias for the command history |
apropos ...keyword | Lists a list of commands including program keywords, especially useful when you only know what the program does, but don't remember the commands |
chsh | Change the shell command |
chsh --list-shells | Nice command to find out if you have to telnet to another machine |
gpg -c filel | Encrypt a file with GNU Privacy Guard |
gpg filel.gpg | Decrypt a file with GNU Privacy Guard |
Popular tools: