Skip to content

Latest commit

 

History

History
193 lines (143 loc) · 3.81 KB

linux-commands-english.md

File metadata and controls

193 lines (143 loc) · 3.81 KB

ls

Lists files and directories in the current directory. Example: ls

cd

Changes the current working directory. Example: cd /home/user/Documents

pwd

Prints the current working directory. Example: pwd

mkdir

Creates a new directory. Example: mkdir new_directory

rmdir

Removes an empty directory. Example: rmdir empty_directory

rm

Removes files or directories. Example: rm file.txt or rm -r directory

touch

Creates a new empty file. Example: touch new_file.txt

cp

Copies files or directories. Example: cp file.txt new_file.txt or cp -r directory new_directory

mv

Moves or renames files or directories. Example: mv file.txt new_file.txt or mv directory new_directory

cat

Displays the contents of a file. Example: cat file.txt

less

Allows you to view the contents of a file one page at a time. Example: less file.txt

head

Displays the first few lines of a file. Example: head file.txt

tail

Displays the last few lines of a file. Example: tail file.txt

grep

Searches for a pattern in a file. Example: grep "pattern" file.txt

find

Finds files or directories that match specific criteria. Example: find /home/user -name "*.txt"

ps

Displays information about running processes. Example: ps aux

kill

Sends a signal to terminate a process. Example: kill PID

chmod

Changes the permissions of a file or directory. Example: chmod 755 file.txt

chown

Changes the owner of a file or directory. Example: chown user:group file.txt

tar

Archives files into a tarball. Example: tar -czvf archive.tar.gz file1.txt file2.txt

unzip

Extracts files from a zip archive. Example: unzip archive.zip

top

Displays information about system processes and resource usage. Example: top

free

Displays information about memory usage. Example: free -m

df

Displays information about disk space usage. Example: df -h

du

Displays information about disk usage for specific directories. Example: du -sh /home/user/Documents

ping

Checks connectivity to a network host. Example: ping google.com

ssh

Securely connects to a remote server. Example: ssh user@server

scp

Copies files securely between hosts. Example: scp file.txt user@server:/path/to/destination

curl

Retrieves data from a URL. Example: curl https://www.example.com

wget

Downloads files from the internet. Example: wget https://www.example.com/file.txt

apt

Manages software packages on Debian-based systems. Example: apt update && apt upgrade

yum

Manages software packages on Red Hat-based systems. Example: yum update

systemctl

Manages system services on systemd-based systems. Example: systemctl start service

journalctl

Displays system logs. Example: journalctl -xe

ifconfig

Displays information about network interfaces. Example: ifconfig

ip

Displays and configures IP addresses, routes, and tunnels. Example: ip addr show

route

Displays and configures network routing. Example: route -n

netstat

Displays information about network connections and socket usage. Example: netstat -an

iptables

Manages firewall rules. Example: iptables -A INPUT -p tcp --dport 22 -j ACCEPT

hostname

Displays or sets the hostname of the system. Example: hostname

uname

Displays information about the Linux kernel. Example: uname -a

date

Displays the current date and time. Example: date

whoami

Displays the name of the current user. Example: whoami

su

Switches to another user account. Example: su - user

sudo

Executes a command as another user with elevated privileges. Example: sudo command

adduser

Adds a new user account. Example: adduser new_user

passwd

Changes the password for a user account. Example: passwd user

usermod

Modifies user account properties