0% found this document useful (0 votes)
8 views6 pages

Linux Commands

The document provides a comprehensive list of basic, file, system, network, and other useful commands in a Unix-like operating system. Each command is accompanied by a brief description and an example of its usage. It serves as a quick reference guide for users to perform various tasks in the terminal.

Uploaded by

meowworld2003
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)
8 views6 pages

Linux Commands

The document provides a comprehensive list of basic, file, system, network, and other useful commands in a Unix-like operating system. Each command is accompanied by a brief description and an example of its usage. It serves as a quick reference guide for users to perform various tasks in the terminal.

Uploaded by

meowworld2003
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/ 6

### Basic Commands

1. **`pwd`**: Print Working Directory. Shows the current directory.

2. **`ls`**: List files and directories.

3. **`cd`**: Change Directory.

4. **`cp`**: Copy files or directories.

5. **`mv`**: Move or rename files or directories.

6. **`rm`**: Remove files or directories.

7. **`mkdir`**: Make Directory.

8. **`rmdir`**: Remove Directory (empty).

9. **`touch`**: Create an empty file or update a file's timestamp.

10. **`cat`**: Concatenate and display file content.

11. **`echo`**: Display text or variable values.


### File Commands
1. **`file`**: Determines file type.
- Example: `file [Link]`
2. **`chmod`**: Change file permissions.
- Example: `chmod 755 [Link]`
3. **`chown`**: Change file owner and group.
- Example: `chown user1 [Link]`
4. **`ln`**: Create hard or symbolic links.
- Example: `ln -s [Link] [Link]` (symbolic link)
5. **`diff`**: Compare files line by line.
- Example: `diff [Link] [Link]
6. **`tar`**: Archive files.
- Example: `tar -cvf [Link] [Link]`, `tar -xvf [Link]
7. **`gzip`**: Compress files.
- Example: `gzip [Link]`
8. **`gunzip`**: Decompress files.
- Example: `gunzip [Link]`
9. **`zip`**: Create a zip archive.
- Example: `zip [Link] [Link]`
10. **`unzip`**: Extract zip archive.
- Example: `unzip [Link]`

### System Commands


1. **`top`**: Display real-time system processes.
- Example: `top`
2. **`ps`**: List running processes.
- Example: `ps aux`
3. **`kill`**: Terminate processes.
- Example: `kill 1234`
4. **`pkill`**: Kill processes by name.
- Example: `pkill firefox`
5. **`systemctl`**: Manage system services.
- Example: `systemctl status apache2`, `systemctl start apache2`
6. **`service`**: Manage system services (older command).
- Example: `service apache2 status`
7. **`reboot`**: Restart the system.
- Example: `reboot`
8. **`shutdown`**: Shut down or restart the system.
- Example: `shutdown now`, `shutdown -r now` (restart)
9. **`df`**: Display disk space usage.
- Example: `df -h`
10. **`du`**: Disk usage of files and directories.
- Example: `du -sh /home/user/`
### Network Commands
1. **`ifconfig`**: Display or configure network interfaces (deprecated, replaced by
`ip`).
- Example: `ifconfig`
2. **`ip`**: Network interface configuration.
- Example: `ip addr show`, `ip link set eth0 up`
3. **`ping`**: Check connectivity to a host.
- Example: `ping [Link]`
4. **`traceroute`**: Trace the route packets take to a network host.
- Example: `traceroute [Link]`
5. **`netstat`**: Network statistics and connections.
- Example: `netstat -tuln`
6. **`ss`**: Utility to investigate sockets.
- Example: `ss -tuln`
7. **`curl`**: Transfer data from or to a server.
- Example: `curl [Link]
8. **`wget`**: Download files from the web.
- Example: `wget [Link]
9. **`nmap`**: Network exploration and security auditing.
- Example: `nmap [Link]`
10. **`iptables`**: Configure network packet filtering rules.
- Example: `iptables -L` (list rules)

### Other Useful Commands


1. **`history`**: Show command history.
- Example: `history`
2. **`alias`**: Create shortcuts for commands.
- Example: `alias ll='ls -l'`
3. **`unalias`**: Remove aliases.
- Example: `unalias ll`
4. **`basename`**: Strip directory and suffix from filenames.
- Example: `basename /home/user/[Link]`
5. **`dirname`**: Strip the last component from the file name.
- Example: `dirname /home/user/[Link]`
6. **`date`**: Display or set the system date and time.
- Example: `date`, `date '+%Y-%m-%d %H:%M:%S'`
7. **`uptime`**: Show how long the system has been running.
- Example: `uptime`
8. **`whoami`**: Show the current user.
- Example: `whoami`
9. **`sudo`**: Execute a command as another user (usually root).
- Example: `sudo ls /root`
10. **`man`**: Manual pages for commands.
- Example: `man man`
### Additional File Management Commands###########################
2. **`tree`**: Display directory contents in a tree-like format.
- Example: `tree /home/user/`
3. **`wc`**: Count words, lines, and characters in files.
- Example: `wc -l [Link]` (count lines in [Link])
### Additional Network Commands
2. **`nmap`**: Network exploration and security auditing.
- Example: `nmap -sP [Link]/24` (ping scan a subnet)
4. **`iwconfig`**: Configure wireless network interfaces.
- Example: `iwconfig wlan0`
5. **`host`**: DNS lookup utility.
- Example: `host [Link]`
6. **`dig`**: DNS lookup and query utility.
- Example: `dig [Link]`

### Additional Miscellaneous Commands


1. **`grep`**: Search for text patterns in files.
- Example: `grep "pattern" [Link]`
6. **`bash`**: Start a new Bash shell session.
- Example: `bash`
7. **`sh`**: Start a new Bourne shell session.
- Example: `sh`
9. **`sort`**: Sort lines of text files.
- Example: `sort [Link]`

You might also like