100% found this document useful (1 vote)
453 views1 page

Linux Cheat Sheet

This document provides summaries of common Linux commands organized into categories such as system information, hardware, users, files, networking, compression/archives, packages, processes, disk usage, and directory traversal. It lists commands like uname, uptime, ifconfig, tar, rpm, du, and cd along with brief explanations of their functions. The document recommends a more detailed Linux command reference guide on another website.

Uploaded by

Colocha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
453 views1 page

Linux Cheat Sheet

This document provides summaries of common Linux commands organized into categories such as system information, hardware, users, files, networking, compression/archives, packages, processes, disk usage, and directory traversal. It lists commands like uname, uptime, ifconfig, tar, rpm, du, and cd along with brief explanations of their functions. The document recommends a more detailed Linux command reference guide on another website.

Uploaded by

Colocha
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

SYSTEM FILE PERMISSION RELATED

#uname -a =>Displaylinux system information #chmod octal file-name =>Change the permissions of file to octal
#uname -r =>isplay kernel release information Example
#uptime =>Show how long the system has been running + load #chmod 777 /data/test.c =>Set rwx permission for owner,group,world
#hostname =>Show system host name #chmod 755 /data/test.c =>Set rwx permission for owner,rw for group
#hostname -i =>Display the IP address of the host and world
#last reboot =>Show system reboot history #chown owner-user file =>Change owner of the file
#date =>Show the current date and time #chown owner-user:owner-group file-name =>Change owner and group
#cal =>Show this month calendar owner of the file
#w =>Display who is online #chown owner-user:owner-group directory =>Change owner and group
#whoami =>Who you are logged in as owner of the directory
#finger user =>Display information about user
NETWORK
HARDWARE
#ifconfig –a =>Display all network ports and ip address
#dmesg =>Detected hardware and boot messages #ifconfig eth0 =>Display specific ethernet port
#cat /proc/cpuinfo =>CPU model #ethtool eth0 =>Linux tool to show ethernet status
#cat /proc/meminfo =>Hardware memory #mii-tool eth0 =>Linux tool to show ethernet status
#cat /proc/interrupts =>Lists the number of interrupts per CPU per I/O device #ping host =>Send echo request to test connection
#lshw =>Displays information on hardware configuration of #whois domain =>Get who is information for domain
the system #dig domain =>Get DNS information for domain
#lsblk =>Displays block device related information in Linux #dig -x host =>Reverse lookup host
#free -m =>Used and free memory (-m for MB) #host google.com =>Lookup DNS ip address for the name
#lspci -tv =>Show PCI devices #hostname –i =>Lookup local ip address
#lsusb -tv =>Show USB devices #wget file =>Download file
#dmidecode =>Show hardware info from the BIOS #netstat -tupl =>List active connections to / from system
#hdparm -i /dev/sda =>Show info about disk sda
#hdparm -tT /dev/sda =>Do a read speed test on disk sda COMPRESSION / ARCHIVES
#badblocks -s /dev/sda =>Test for unreadable blocks on disk sda
#tar cf home.tar home =>Create tar named home.tar containing home/
USERS #tar xf file.tar =>Extract the files from file.tar
#tar czf file.tar.gz files =>Create a tar with gzip compression
#id =>Show the active user id with login and group #gzip file =>Compress file and renames it to file.gz
#last =>Show last logins on the system
#who =>Show who is logged on the system INSTALL PACKAGE
#groupadd admin =>Add group "admin"
#useradd -c "Sam Tomshi" =>g admin -m sam #Create user "sam" #rpm -i pkgname.rpm =>Install rpm based package
#userdel sam =>Delete user sam #rpm -e pkgname =>Remove package
#adduser sam =>Add user "sam"
#usermod =>Modify user information INSTALL FROM SOURCE

FILE COMMANDS #./configure


#make
#ls –al =>Display all information about files/ directories #make install
#pwd =>Show the path of current directory
#mkdir directory-name =>Create a directory SEARCH
#rm file-name =>Delete file
#rm -r directory-nam =>Delete directory recursively #grep pattern files =>Search for pattern in files
#rm -f file-name =>Forcefully remove file #grep -r pattern dir =>Search recursively for pattern in dir
#rm -rf directory-name =>Forcefully remove directory recursively #locate file =>Find all instances of file
#cp file1 file2 =>Copy file1 to file2 #find /home/tom -name 'index*' =>Find files names that start with "index"
#cp -r dir1 dir2 =>Copy dir1 to dir2, create dir2 if it doesn’t exist #find /home -size +10000k =>Find files larger than 10000k in /home
#mv file1 file2 =>Rename source to dest / move source to directory
#ln –s /path/to/file-name link-name #Create symbolic link to file-name
#touch file =>Create or update file LOGIN (SSH AND TELNET)
#cat > file =>Place standard input into file
#more file =>Output contents of file
#head file =>Output first 10 lines of file #ssh user@host =>Connect to host as user
#tail file =>Output last 10 lines of file #ssh -p port user@host =>Connect to host using specific port
#tail -f file =>Output contents of file as it grows starting with the #telnet host =>Connect to the system using telnet port
last 10 lines
#gpg -c file =>Encrypt file FILE TRANSFER
#gpg file.gpg =>Decrypt file
#wc =>print the number of bytes, words, and lines in files scp
#xargs =>Execute command lines from standard input #scp file.txt server2:/tmp =>Secure copy file.txt to remote host /tmp folder
rsync
PROCESS RELATED #rsync -a /home/apps /backup/ =>Synchronize source to destination

#ps =>Display your currently active processes DISK USAGE


#ps aux | grep 'telnet' =>Find all process id related to telnet process
#pmap =>Memory map of process #df –h =>Show free space on mounted filesystems
#top =>Display all running processes #df -i =>Show free inodes on mounted filesystems
#killpid =>Kill process with mentioned pid id #fdisk -l =>Show disks partitions sizes and types
#killall proc =>Kill all processes named proc #du -ah =>Display disk usage in human readable form
#pkill process-name =>Send signal to a process with its name #du -sh =>Display total disk usage on the current directory
#bg =>Lists stopped or background jobs
#fg =>Brings the most recent job to foreground DIRECTORY TRAVERSE
#fg n =>Brings job n to the foreground
#cd .. =>To go up one level of the directory tree
#cd =>Go to $HOME directory
#cd /test =>Change to /test directory

MORE DETAILED : HTTP://LINOXIDE.COM/GUIDE/LINUX-COMMAND-SHELF.HTML

You might also like