Tuesday, September 6, 2016

Unix - Useful Commands

This quick guide lists commands, including a syntax and brief description. For more detail, use −
$man command

Files and Directories
These commands allow you to create directories and handle files.
Command
Description
cat
Display File Contents
cd
Changes Directory to dir name
chgrp
change file group
chmod
Changing Permissions
cp
Copy source file into destination
file
Determine file type
find
Find files
grep
Search files for regular expressions.
head
Display first few lines of a file
ls
Display information about file type.
mkdir
Create a new directory dirname
more
Display data in paginated form.
mv
Move (Rename) a oldname to newname.
pwd
Print current working directory.
rm
Remove (Delete) filename
rmdir
Delete an existing directory provided it is empty.
tail
Prints last few lines in a file.
touch
Update access and modification time of a file.

Manipulating data
The contents of files can be compared and altered with the following commands.
Command
Description
awk
Pattern scanning and processing language
cmp
Compare the contents of two files
comm
Compare sorted data
cut
Cut out selected fields of each line of a file
diff
Differential file comparator
expand
Expand tabs to spaces
join
Join files on some common field
sort
Sort file data
split
Split file into smaller files
wc
Count words, lines, and characters
vi
Opens vi text editor
vim
Opens vim text editor

Compressed Files
Files may be compressed to save space. Compressed files can be created and examined −
Command
Description
compress
Compress files
gunzip
Uncompress gzipped files
gzip
GNU alternative compression method
uncompress
Uncompress files
unzip
List, test and extract compressed files in a ZIP archive
zcat
Cat a compressed file
zcmp
Compare compressed files
zdiff
Compare compressed files
zmore
File perusal filter for crt viewing of compressed text

Network Communication
These following commands are used to send and receive files from a local UNIX hosts to the remote host around the world.
Command
Description
ftp
File transfer program
rcp
Remote file copy
rlogin
Remote login to a UNIX host
rsh
Remote shell
telnet
Make terminal connection to another host
ssh
Secure shell terminal or command connection
scp
Secure shell remote file copy
sftp
secure shell file transfer program

Misc Commands
These commands list or alter information about the system
Command
Description
chgrp
Change the group ownership of a file
chown
Change owner
date
Print the date
du
Print amount of disk usage
echo
Echo arguments to the standard options
exit
Quit the system
Show group memberships
homequota
Show quota and file usage
iostat
Report I/O statistics
kill
Send a signal to a process
last
Show last logins of users
logout
log off UNIX
netstat
Show network status
passwd
Change user password
passwd
Change your login password
printenv
Display value of a shell variable
ps
Display the status of current processes
top
Display all system processes
umask
Show the permissions that are given to view files by default
uname
Display name of the current system
uptime
Get the system up time
useradd
Create a user account
users
Print names of logged in users
vmstat
Report virtual memory statistics
w
Show what logged in users are doing
who
List logged in users


No comments:

Post a Comment