Anda di halaman 1dari 2

commands and what they are used for.

sudo command
run command as root
apt-get - used to install, remove, upgrade and more.
Movement In The directory
cd - Change Directory
pwd - Print Working Directory
Managing Files and Text
cp - Copy
ls - List
mkdir - Make Directory
mv - Move
rm - Remove
grep - Search for Text Strings
head - Display Start of File
less - Display Part of File
more - Display Part of File
tail - View the End of a File
Managing System and Program Information
cal - Calendar
date - Date
Troubleshooting
fsck - File System Check
Managing Network Connections
chkconfig - Check Activated Services
ping - Test Network Connections
ftp - file Transfer Protocol
host - Check IP of Domain
ifconfig - Configure Network Devices
netstat - Display Routing Table
route - Set Routes
telnet - Connect to telnet
traceroute - Display Route
Manage Drives and Formats
mount - Mount a Drive
umount - Unmount Drive
fdisk - Format Disk
dd - Dupliate Disk
df - Disk Free Space
Managing Rights to Files and Directories
chmod - Change Mode
su - Switch User

Managing Users and Groups


passwd - Create Password
groupadd - Add a Group
groupmod - Modify a Group
chgrp - Change Group
groupdel - Delete Group
Commands for Deleting Files
rm: Deletes files and the deleted files can be recovered.
shred: Deletes files forever and deleted files can never be recovered.
Command for Deleting Folders
rmdir: Deletes folder.
The terminal command for deleting file(s) is rm and the format of rm command is:
rm [options] [file]
If you give wrong file path for rm command it displays an error message and move
on to the next file. Sometimes it also asks for confirmation to delete a file.
rm Command Options
There are six rm command options.
-f

deletes read-only files without any confirmation.

-i Asks for confirmation before deleting every file.


If you use both -f and -i options for rm command, then the one which appears las
t in the command format (in terminal) is used by rm.
-q

Deactivates all the warning messages.

-R or -r
Delete directory and files in recursive direction, the specified director
y along with its sub-directory and files.
-v

Displays the file names on the terminal which is being deleted.

-I

Displays message when you are deleting more than 3 files at a time.

You should never use rm command together with sudo in the following format: sudo
rm -R /, rm -f /* or sudo rm -r / It deletes all the files and data in the root
directory and on all the mounted volumes.
shred Command
shred command is also used to delete files form terminal but it overwrite a file
to hide its contents, and deletes the files permanently. By default shred overw
rites the files 25 times if an exact number of overwriting if not allowed.
The terminal command for deleting file(s) is shred and the format of shred comma
nd is: shred [options] [file]

Anda mungkin juga menyukai