There are no items in your cart
Add More
Add More
| Item Details | Price | ||
|---|---|---|---|
Explanation: Displays files and folders in the current directory.
ls
ls -l
ls -la
-l → Displays detailed listing (permissions, owner, size, date)-a → Shows hidden files (files starting with .)Explanation: Shows the full path of the current directory.
pwd
Explanation: Used to navigate between directories.
cd /etc
cd ..
cd ~
/etc → Absolute path.. → Move one directory up~ → Home directory of the current userExplanation: Creates new directories.
mkdir test
mkdir -p project/logs
-p → Creates parent directories if they do not existExplanation: Deletes files and directories.
rm file.txt
rm -r folder
rm -rf folder
-r → Removes directories recursively (within a directory)-f → Forces deletion without confirmation
⚠️ Warning: rm -rf permanently deletes data and should be used with caution.
Explanation: Copies files or directories from one location to another.
cp file1 file2
cp -r dir1 dir2
-r → Copies directories recursively (within a directory)Explanation: Moves files or renames them.
mv file.txt /tmp/
mv old.txt new.txt
Explanation: Displays the contents of a file.
cat file.txt
Explanation: Allows scrolling through files page by page.
less /var/log/syslog
Explanation: Displays the first few lines of a file.
head file.txt
head -n 5 file.txt
-n → Specifies number of lines to displayExplanation: Displays the last few lines of a file.
tail file.txt
tail -f /var/log/messages
-f → Continuously monitors file updates (used for logs)Explanation: Command-line text editors.
nano file.txt
vi file.txt
Explanation: Searches for files based on conditions.
find / -name file.txt
/ → Starting directory-name → Search by file nameExplanation: Searches for patterns inside files.
grep "error" logfile.txt
grep -i "root" /etc/passwd
-i → Case-insensitive searchwhoami
id
Explanation: Modifies file permissions.
chmod 755 script.sh
chmod u+x script.sh
755 → Owner: read/write/execute, Others: read/executeu+x → Adds execute permission to the ownerchown user:user file.txt
ps aux
a → Show processes from all usersu → Display user-oriented formatx → Show processes without terminaltop
htop
kill 1234
kill -9 1234
-9 → Forcefully kill a processdf -h
-h → Human-readable formatdu -sh /var/log
-s → Summary only-h → Human-readable formatfree -h
-h → Human-readable outputip a
ping google.com
ss -tulnp
-t → TCP ports-u → UDP ports-l → Listening ports-n → Numeric output-p → Show process namecurl https://example.com
apt update
apt install nginx
apt remove nginx
yum install httpd
dnf install httpd
sudo apt update
reboot
shutdown -h now
-h → Halt the systemnow → Execute immediately