0% found this document useful (0 votes)
5 views

linux Command

Linux contains commands
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
0% found this document useful (0 votes)
5 views

linux Command

Linux contains commands
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/ 2

Command Description Example

pwd Print working directory pwd

ls List files and directories ls

cd Change directory cd directory_name

mkdir Make directory mkdir new_directory

rmdir Remove directory rmdir empty_directory

cp Copy files or directories cp file.txt /path/to/destination

mv Move files or directories mv file.txt /path/to/destination

rm Remove files or directories rm file.txt

touch Create an empty file touch new_file.txt

cat Display or concatenate files cat file.txt

man Display the manual for a command man ls

chmod Change file permissions chmod 755 file.txt

chown Change file owner and group chown user:group file.txt

kill Terminate a process kill process_id

top Display system activity in real-time top

df Display disk space usage df -h

du Display file and directory space usage du -h


head Display the beginning of a file head file.txt

tail Display the end of a file tail file.txt

grep Search for a pattern in files grep pattern file.txt

find Search for files and directories find /path -name “*.txt”

tar -cvf archive.tar


tar Create or extract tar archives
/path/to/directory

zip Create or extract zip archives zip archive.zip file.txt

unzip Extract files from a zip archive unzip archive.zip

ssh Connect to a remote server ssh username@hostname

whoami Display the current username whoami

Execute a command with superuser


sudo sudo command
privileges

su Switch user or become superuser su username

passwd Change user password passwd

echo Display a message or output to a file echo “Hello, Linux!” > greeting.txt

history Display command history history

wc Count lines, words, and characters in a file wc file.txt

sed Stream editor for text manipulation sed ‘s/old/new/g’ file.txt

You might also like