TOP USE Full Unix/linux commands
head: This command displays the first few lines of a file.
tail: This command displays the last few lines of a file.
diff: This command compares the contents of two files.
tar: This command creates or extracts a compressed archive file.
curl: This command downloads or uploads data to/from a server.
wget: This command downloads files from the internet.
scp: This command securely copies files between local and remote hosts.
ssh-keygen: This command generates SSH keys for secure authentication.
vi or nano: These are text editors used to edit files in the terminal.
uptime: This command displays the current system uptime and load average.
free: This command displays the amount of free and used memory.
top: This command displays real-time system resource usage.
crontab: This command schedules tasks to run automatically at specified intervals.
kill: This command terminates a running process.
man: This command displays the manual pages for a command.
chmod: This command changes the file permissions of a file or directory.
chown: This command changes the ownership of a file or directory.
tar: This command creates or extracts a compressed archive file.
gzip: This command compresses a file.
unzip: This command extracts files from a compressed archive.
du: This command displays disk usage of files and directories.
df: This command displays the amount of disk space available and used.
ssh: This command connects to a remote server securely.
scp: This command securely copies files between local and remote hosts.
find: This command searches for files in a directory hierarchy.
sed: This command stream edits a file or input stream.
awk: This command processes and analyzes text files.
cut: This command extracts fields or columns from a file.
sort: This command sorts the contents of a file or input stream.
history: This command displays a list of recently used commands.
ls: This command lists the contents of a directory.
cd: This command changes the current working directory.
pwd: This command displays the current working directory.
mkdir: This command creates a new directory.
rmdir: This command removes a directory.
cp: This command copies files or directories from one location to another.
mv: This command moves files or directories from one location to another.
rm: This command removes a file or directory.
cat: This command displays the contents of a file.
grep: This command searches for a pattern in a file.
ping: This command tests the connectivity between two hosts.
netstat: This command displays network statistics and active connections.
ifconfig: This command displays network interface configuration information.
top: This command displays real-time system resource usage.
ps: This command displays a list of active processes
head: Display the first few lines of a file named "example.txt":
bash
head example.txt
tail: Display the last few lines of a file named "log.txt":
bash
tail -n 5 log.txt
diff: Compare the contents of two files named "file1.txt" and "file2.txt":
diff file1.txt file2.txt
tar: Create a compressed archive file named "archive.tar.gz" containing the files in a directory called "folder":
tar -czf archive.tar.gz folder
curl: Download a file named "example.txt" from a remote server and save it locally:
arduino
curl -O https://example.com/example.txt
wget: Download a file named "image.jpg" from a URL and save it locally:
arduino
wget https://example.com/image.jpg
scp: Copy a file named "file.txt" from a local directory to a remote server:
ruby
scp file.txt user@remotehost:/path/to/destination
ssh-keygen: Generate a new SSH key pair for secure authentication:
ssh-keygen
vi (or nano): Open a file named "document.txt" for editing using the Vi or Nano text editor respectively:
javascript
vi document.txt
nano document.txt
uptime: Display the system's uptime and load average:
bash
uptime
free: Display the amount of free and used memory:
c
free
top: Display real-time system resource usage:
css
top
crontab: Edit the cron table to schedule tasks to run automatically at specified intervals:
crontab -e
kill: Terminate a running process with a specific process ID (PID):
bash
kill PID
man: Display the manual page for a specific command, such as "ls":
bash
man ls
chmod: Change the file permissions of a file or directory. For example, give read and write permissions to the owner of the file:
bash
chmod u+rw file.txt
chown: Change the ownership of a file or directory. For example, change the owner of "file.txt" to a user named "newowner":
bash
chown newowner file.txt
tar: Create a compressed archive file named "archive.tar.gz" containing the files in a directory called "folder":
tar -czf archive.tar.gz folder
gzip: Compress a file named "file.txt" into a compressed file named "file.txt.gz":
gzip file.txt
unzip: Extract files from a compressed archive named "archive.zip" into the current directory:
python
unzip archive.zip
du: Display the disk usage of files and directories in the current directory:
bash
du
df: Display the amount of disk space available and used for all mounted filesystems:
bash
df -h
ssh: Connect to a remote server securely. For example, connect to a server with IP address "192.168.0.100" using username "user":
sql
ssh user@192.168.0.100
scp: Copy a file named "file.txt" from a local directory to a remote server:
ruby
scp file.txt user@remotehost:/path/to/destination
find: Search for files in a directory hierarchy. For example, find all text files in the current directory and its subdirectories:
lua
find . -type f -name "*.txt"
sed: Perform stream editing on a file or input stream. For example, replace all occurrences of "old" with "new" in a file named "data.txt":
kotlin
sed 's/old/new/g' data.txt
awk: Process and analyze text files. For example, print the second field of a file named "data.txt" using a comma as the delimiter:
kotlin
awk -F, '{print $2}' data.txt
cut: Extract fields or columns from a file. For example, extract the first three columns from a file named "data.txt" using a tab as the delimiter:
bash
cut -f 1-3 -d $'\t' data.txt
sort: Sort the contents of a file or input stream. For example, sort the lines of a file named "list.txt" in reverse order:
bash
sort -r list.txt
history: Display a list of recently used commands:
bash
history
ls: List the contents of a directory. For example, list all files and directories in the current directory:
bash
ls
cd: Change the current working directory to a specified directory. For example, change to the "Documents" directory:
bash
cd Documents
pwd: Display the current working directory:
bash
pwd
mkdir: Create a new directory named "folder":
arduino
mkdir folder
rmdir: Remove an empty directory named "folder":
arduino
rmdir folder
cp: Copy a file named "file.txt" from the current directory to a destination directory:
bash
cp file.txt /path/to/destination
mv: Move a file named "file.txt" from the current directory to a destination directory:
bash
mv file.txt /path/to/destination
rm: Remove a file named "file.txt":
bash
rm file.txt
cat: Display the contents of a file named "file.txt":
bash
cat file.txt
grep: Search for a pattern "pattern" in a file named "file.txt":
perl
grep "pattern" file.txt
ping: Test the connectivity between two hosts. For example, ping a host with IP address "192.168.0.1":
ping 192.168.0.1
netstat: Display network statistics and active connections:
css
netstat -a
ifconfig: Display network interface configuration information:
ifconfig
top: Display real-time system resource usage:
css
top
ps: Display a list of active processes:
ps aux
These examples should give you a good starting point for using the commands effectively. Remember to consult the command's manual page (man) for more information and options specific to each command.
No comments