mkdir - make directories
eg:- mkdir vishnu
cd - change directories. Use cd to change directories.
eg:- cd /home/vishnu/test/
mv- used to move files or directories and also used to chage its name
eg:- mv test.txt /home/vishnu/example/
mv test.txt example.txt
pwd - print working directory or present working directory
eg:- pwd
/home/vishnu/test/example/
rmdir - Remove an existing directory
rm -rf
eg:- rmdir test
rm -rf test
chown - change file owner and group
eg:- chown vishnu.vishnu example.txt
chown vishnu. * -R
chown vishnu. example.txt
chgrp - change group
eg:- chgrp vishnu text.txt
chgrp vishnu example
chmod - change file access permissions
eg:- chmod 644 test.txt
chmod 777 example
usage;- chmod [ .. ] file/folder
u - User who owns the file.
g - Group that owns the file.
o - Other.
a - All.
r - Read the file.
w - Write or edit the file.
x - Execute or run the file as a program.
Numeric Permissions:
CHMOD can also to attributed by using Numeric Permissions:
400 read by owner
040 read by group
004 read by anybody (other)
200 write by owner
020 write by group
002 write by anybody
100 execute by owner
010 execute by group
001 execute by anybody
ls - Short listing of directory contents
eg:- ls
ls -la
usage:-
-a list hidden files
-d list the name of the current directory
-F show directories with a trailing '/'
executable files with a trailing '*'
-g show group ownership of file in long listing
-i print the inode number of each file
-l long listing giving details about files and directories
-R list all subdirectories encountered
-t sort by time modified instead of name
cp - Copy files
eg:- cp text.txt /vishnu/example/
cp -pr example /home/folders/
cal month year - Prints a calendar for the specified month of the specified year.
clear - Clears the terminal screen.(ctrl + l)
cmp file1 file2 - Compares two files, reporting all discrepancies. Similar to the diff command, though the output format differs.
diff file1 file2 - Compares two files, reporting all discrepancies. Similar to the cmp command, though the output format differs.
passwd - change password
Saturday, August 1, 2009
Linux Filesystem Management
df :- free disk space
du :- disk usage
du -sh :- disk usage in human readable format
cat /proc/swap :- see swap details
free- free memory usage
cat /proc/meminfo :- get info about RAM in ur system
fdisk :- Used to fix or create partitions on a hard drive
mount :- Used to mount a filesystem.
umount :- Unmounts a filesystem
du :- disk usage
du -sh :- disk usage in human readable format
cat /proc/swap :- see swap details
free- free memory usage
cat /proc/meminfo :- get info about RAM in ur system
fdisk :- Used to fix or create partitions on a hard drive
mount :- Used to mount a filesystem.
umount :- Unmounts a filesystem
at
8:47 AM
File compression, backing up and restoring
gunzip :- unzip - unzip a gz file.
gzip :-gzip - zip a file to a gz file.
tar :- Can store files on tapes.
Usage: tar -cvf - Archive copy groups of files
zip :-zip - make a zip file.
grep :- grep pattern filename
at
8:45 AM
File editing and managing tools
emacs :-Full screen editor.
gitview :-A hexadecimal or ASC file viewer.
Head:- head linuxdoc.txt - Look at the first 10 lines of linuxdoc.txt.
Jed:- Editor
less :- Used to view files.
more :- Used to view files.
pico :-Simple text editor.
tail :-tail linuxdoc.txt - Look at the last 10 lines of linuxdoc.txt.
vi :-Editor with a command mode and text mode. Starts in command mode.
Vim :- advanced text editor
at
8:43 AM
Linux Process management
ps :- To see currently running process
kill :- To stop any process by PID i.e. to kill process
eg:- kill process id
killall :- To stop processes by name i.e. to kill process
eg:- killall firefox
ps -ag :- To get information about all running process
ps aux :- To display the owner of the processes along with the processes
top :- To see currently running processes and other information like memory and CPU usage with real time updates.
pstree :- To display a tree of processes
skill :- Report process status.
gitps :- a graphical process viewer and killer program
kill :- To stop any process by PID i.e. to kill process
eg:- kill process id
killall :- To stop processes by name i.e. to kill process
eg:- killall firefox
ps -ag :- To get information about all running process
ps aux :- To display the owner of the processes along with the processes
top :- To see currently running processes and other information like memory and CPU usage with real time updates.
pstree :- To display a tree of processes
skill :- Report process status.
gitps :- a graphical process viewer and killer program
at
8:41 AM
Subscribe to:
Posts (Atom)



