List of Unix User Commands
16 posts
• Page 1 of 2 • 1, 2
List of Unix User Commands
Handy Unix User Commands
Note: Many, but not all of these commands will work in Mac OS X's Terminal.app. Different Linux distributions may also handle some of these commands differently.
../ represents one directory higher
cat filename display file contents
cat stuff1 stuff2 > allStuff combine files
cat someStuff >> allStuff append to a file
cd dirName go into the directory dirName
chmod [permission mode] file change the permission of a file (4=read, 2=write, 1=execute for user/group/all)
chown user file change the owner of a file
clear clear the terminal
cp file1 file2 copy file1 to file2
date print current date and time
find someStuff locate a file or directory
finger user get some info about a user
free display some stats about memory usage
ftp hostname connect to an ftp server
gunzip file.gz extract contents of gzipped compressed files
hostname display the hostname of the computer
kill [ID] terminate a process
less file view file in terminal with ability to scroll up and down
ln sourceName destDirectory create symbolic link to a file
locate file locate a file from a database maintained by the computer
login login to the computer
lpr file sends a file to the print spooler
ls list the contents of the current directory
ls directory list the contents of a given directory
man program display manual pages for a program
mkdir directory create a directory
more file view file in terminal with ability to scroll down
mv source target move a file
passwd user change a user's password
pico file open a file in the pico text editor
pwd print the full pathname of the current directory
quota user display the disk quota allocated to a user
rm file delete a file
rmdir directory delete a directory
rm -rf anything forcefully delete something (like a directory, recursively)
sh the standard Unix shell, bash
ssh hostname open an ssh session
su switch to the superuser's (root's) identity
su user switch to another user's identity
tail file print the last 10 lines of a file
telnet hostname open a telnet session
touch file update the access time and last modified time for a file to the current time and date
uname -a print system information
vi file open a file in the vi or vim text editor
who am i gives info about the current user
who -uH gives info and idle times for all users
Handy Linux Sys Admin Commands
halt shuts down the machine
mount /mnt/floppy mounts the floppy fs
mount /mnt/cdrom mounts the cd-rom fs
shutdown -r "now" restarts the machine
umount mountedLocation unmounts a filesystem
update db update file database used by locate command
Please post your additions to this list
Last edited by phileysmiley on Sun Jun 11, 2006 11:50 pm, edited 5 times in total.
- phileysmiley
- Media Director
- Posts: 13745
- Joined: Mon Jun 21, 2004 4:20 pm
- Location: Delray Beach FL USA
- Real Name: Larry Richman
Fantastic, hope the linux people do post additions. This is something I will print out and tape up on the workshop wall
some others I found (no linux expert here though)
-------------------------
logout
logs you out of a Telnet session
df
displays how much space on the disks (harddrive partitions) is free
du [-a] [-s] directories
tells you how much disk space your files occupy; the -a option displays the space used by each file, not just each directory; the -s option displays the total space used for each directory but not subdirectory
help
provides online help; several topics have been included in the help system available on the servers
lynx servername or URL
Lynx is a text-based, non-graphical web brower for use in Telnet session
mesg [n|y]
lets you control whether other people can use the talk command to interrupt you with on-screen messaging; mesg n will block the interruptions; mesg y will allow interruptions
nslookup IP address or server alias
provides conversion of an IP address to an alias of a computer if it is registered in DNS (Domain Name Service) or will provide the IP address for an alias
pine
a program which allows you to read and send mail; information concerning the use of pine can be found elsewhere in the documentation or by reading the online manual pages for pine (man pine)
ping IP address or server alias
sends a ping packet to another server; this provides information concerning the time it takes for information to make the round trip to the other computer; it will also tell you whether the other server is on-line at that time
ps
displays information about your processes/jobs/programs which are running on the server
talk username@servername
allows you to talk to another user by typing messages to each other on-screen; to prevent someone from talking to you, see the mesg n command
traceroute IP address or server alias
provides information concerning the route which packets must take to get from your computer (the server in this case) to a remote computer/server; typically used to diagnose possible problems in packet routing
w
provides information concerning who is logged into the system and some details on how they are connected
write username
sends a message to another person using the system; to prevent someone from writing to you, see the mesg n command
also see http://www.ss64.com/bash/index.html
some others I found (no linux expert here though)
-------------------------
logout
logs you out of a Telnet session
df
displays how much space on the disks (harddrive partitions) is free
du [-a] [-s] directories
tells you how much disk space your files occupy; the -a option displays the space used by each file, not just each directory; the -s option displays the total space used for each directory but not subdirectory
help
provides online help; several topics have been included in the help system available on the servers
lynx servername or URL
Lynx is a text-based, non-graphical web brower for use in Telnet session
mesg [n|y]
lets you control whether other people can use the talk command to interrupt you with on-screen messaging; mesg n will block the interruptions; mesg y will allow interruptions
nslookup IP address or server alias
provides conversion of an IP address to an alias of a computer if it is registered in DNS (Domain Name Service) or will provide the IP address for an alias
pine
a program which allows you to read and send mail; information concerning the use of pine can be found elsewhere in the documentation or by reading the online manual pages for pine (man pine)
ping IP address or server alias
sends a ping packet to another server; this provides information concerning the time it takes for information to make the round trip to the other computer; it will also tell you whether the other server is on-line at that time
ps
displays information about your processes/jobs/programs which are running on the server
talk username@servername
allows you to talk to another user by typing messages to each other on-screen; to prevent someone from talking to you, see the mesg n command
traceroute IP address or server alias
provides information concerning the route which packets must take to get from your computer (the server in this case) to a remote computer/server; typically used to diagnose possible problems in packet routing
w
provides information concerning who is logged into the system and some details on how they are connected
write username
sends a message to another person using the system; to prevent someone from writing to you, see the mesg n command
also see http://www.ss64.com/bash/index.html
- marathonman
Linux useful commands
Useful commands:
cd................Change Directory
cp................Copy File(s)
cat...............Print Out A File Onto The Screen
mv................Move File(s)
mkdir.............Make A Directory
locate............Find A File(s)
ed................Editor
vi................Editor
ls -a.............List ALL Files
locate /..........List ALL Files on entire hard drive
rm................Delete
tar...............Untar (like zip) a file
netstat -r........Show all computers connected
pine..............Opens pine, and e-mail system
telnet............Program to connect to other computers
lynx..............Internet browser
who...............Show who you are
kill..............Stop a program
man...............Get help
passwd...........Change password
ls ................. show directory, in alphabetical order
logout ............. logs off system
mkdir .............. make a directory
rmdir .............. remove directory (rm -r to delete folders with files)
rm ................. remove files
cd ................. change current directory
man (command) ...... shows help on a specific command
talk (user) ........ pages user for chat - (user) is a email address
write (user) ....... write a user on the local system (control-c to end)
pico (filename) .... easy to use text editor to edit files
pine ............... easy to use mailer
more (file) ........ views a file, pausing every screenful
sz ................. send a file (to you) using zmodem
rz ................. recieve a file (to the unix system) using zmodem
telnet (host) ...... connect to another Internet site
ftp (host) ......... connects to a FTP site
archie (filename) .. search the Archie database for a file on a FTP site
irc ................ connect to Internet Relay Chat
lynx ............... a textual World Wide Web browset
gopher ............. a Gopher database browser
tin, trn ........... read Usenet newsgroups
passwd ............. change your password
chfn ............... change your "Real Name" as seen on finger
chsh ............... change the shell you log into
grep ............... search for a string in a file
tail ............... show the last few lines of a file
who ................ shows who is logged into the local system
w .................. shows who is logged on and what they're doing
finger (emailaddr).. shows more information about a user
df ................. shows disk space available on the system
du ................. shows how much disk space is being used up by folders
chmod .............. changes permissions on a file
bc ................. a simple calculator
make ............... compiles source code
gcc (file.c) ....... compiles C source into a file named 'a.out'
gzip ............... best compression for UNIX files
zip ................ zip for IBM files
tar ................ combines multiple files into one or vice-versa
cd................Change Directory
cp................Copy File(s)
cat...............Print Out A File Onto The Screen
mv................Move File(s)
mkdir.............Make A Directory
locate............Find A File(s)
ed................Editor
vi................Editor
ls -a.............List ALL Files
locate /..........List ALL Files on entire hard drive
rm................Delete
tar...............Untar (like zip) a file
netstat -r........Show all computers connected
pine..............Opens pine, and e-mail system
telnet............Program to connect to other computers
lynx..............Internet browser
who...............Show who you are
kill..............Stop a program
man...............Get help
passwd...........Change password
ls ................. show directory, in alphabetical order
logout ............. logs off system
mkdir .............. make a directory
rmdir .............. remove directory (rm -r to delete folders with files)
rm ................. remove files
cd ................. change current directory
man (command) ...... shows help on a specific command
talk (user) ........ pages user for chat - (user) is a email address
write (user) ....... write a user on the local system (control-c to end)
pico (filename) .... easy to use text editor to edit files
pine ............... easy to use mailer
more (file) ........ views a file, pausing every screenful
sz ................. send a file (to you) using zmodem
rz ................. recieve a file (to the unix system) using zmodem
telnet (host) ...... connect to another Internet site
ftp (host) ......... connects to a FTP site
archie (filename) .. search the Archie database for a file on a FTP site
irc ................ connect to Internet Relay Chat
lynx ............... a textual World Wide Web browset
gopher ............. a Gopher database browser
tin, trn ........... read Usenet newsgroups
passwd ............. change your password
chfn ............... change your "Real Name" as seen on finger
chsh ............... change the shell you log into
grep ............... search for a string in a file
tail ............... show the last few lines of a file
who ................ shows who is logged into the local system
w .................. shows who is logged on and what they're doing
finger (emailaddr).. shows more information about a user
df ................. shows disk space available on the system
du ................. shows how much disk space is being used up by folders
chmod .............. changes permissions on a file
bc ................. a simple calculator
make ............... compiles source code
gcc (file.c) ....... compiles C source into a file named 'a.out'
gzip ............... best compression for UNIX files
zip ................ zip for IBM files
tar ................ combines multiple files into one or vice-versa
I wrote this a while ago in response to someone's question about the 'chmod' command and permissions in UNIX systems. I hope somebody finds it useful:
chmod is designed to change permissions on a file or folder. you currently recognize the digits that represent this as 777. Hopefully that will change. If you enter the command ls -l you will see all the permissions for each file or folder that is listed in the format:
-rwxrwxrwx for a file
drwxrwxrwx for a folder ('d' at the beginning denotes a folder)
'r' stands for read
'w' stands for write
'x' stands for execute
so, why are there three sets of rwx?
the first set refers to the permissions of the owner of the file (this is the user who created it)
-rwxrwxrwx
...^
..me
the second set refers to the permissions of the users who are logged into the local machine/area
-rwxrwxrwx
....... ^
......users
the third set refers to the permissions of the rest of the world that can see your files. This normally only matters if your files are on your webspace.
-rwxrwxrwx
.............^
..........global
so now we can divide them up a little more to look at them closely
- rwx rwx rwx
this currently coresponds with the numbers 777. This is because they are in binary so they can be easily handled by the operating system.
each set of permissions rwx are represented by three bits which can take on the values of 1 and 0.
the 'x' position corresponds with the value 2^0,
the 'w' position corresponds with the value 2^1,
the 'r' position corresponds with the value 2^2
these translate into 4, 2, and 1. So r = 4, w = 2, x = 1
In order to decide which number you will use for each of these you must decide which permissions you want. If you want just yourself to have full access to the files, but every one else only allowed to read and execute them you would use:
chmod 755 this translates into -rwxr-xr-x
by adding the values of the permissions you want to give you are able to decide which to put after the chmod command.
say you want to give yourself read and write permission, but not execute permission, and not let anyone else use your files at all you would use:
chmod 600 this translates into -rw-------
this is often how bin files come. You have read and write access to them, but not execute access. so you have to change the permissions to allow yourself to execute the executable.
you can do any combination of numbers between 0 and 7 for all values
remember:
r = 4
w = 2
x = 1
so:
0 = --- 0 + 0 + 0
1 = --x 0 + 0 + 1
2 = -w- 0+ 2 + 0
3 = -wx 0+ 2 + 1
4 = r-- 4 + 0 + 0
5 = r-x 4 + 0 + 1
6 = rw- 4 + 2 + 0
7 = rwx 4 + 2 + 1
If you are still confused as to how they work, I can pull it straight out of my UNIX workbook and see if they have a better explanation, but that is how it is done.
If you want to install a program you should log in as root and then make sure that at least you have full privilages 700 (-rwx------). So technically, you can use 777 (-rwxrwxrwx) and you will have no problem doing anything you want with the file, but neither will any other user on your system. I wouldn't worry about it since regular users can't navigate into your directories. But if you want to have files that they can't edit in directories they can access, 755 (-rwxr-xr-x) is the minimum you need. If you don't want them to be able to even use or see their contents 700 is needed.
Hope that explains it for yah. Any more questions, I would be glad to take a crack at an answer.
chmod is designed to change permissions on a file or folder. you currently recognize the digits that represent this as 777. Hopefully that will change. If you enter the command ls -l you will see all the permissions for each file or folder that is listed in the format:
-rwxrwxrwx for a file
drwxrwxrwx for a folder ('d' at the beginning denotes a folder)
'r' stands for read
'w' stands for write
'x' stands for execute
so, why are there three sets of rwx?
the first set refers to the permissions of the owner of the file (this is the user who created it)
-rwxrwxrwx
...^
..me
the second set refers to the permissions of the users who are logged into the local machine/area
-rwxrwxrwx
....... ^
......users
the third set refers to the permissions of the rest of the world that can see your files. This normally only matters if your files are on your webspace.
-rwxrwxrwx
.............^
..........global
so now we can divide them up a little more to look at them closely
- rwx rwx rwx
this currently coresponds with the numbers 777. This is because they are in binary so they can be easily handled by the operating system.
each set of permissions rwx are represented by three bits which can take on the values of 1 and 0.
the 'x' position corresponds with the value 2^0,
the 'w' position corresponds with the value 2^1,
the 'r' position corresponds with the value 2^2
these translate into 4, 2, and 1. So r = 4, w = 2, x = 1
In order to decide which number you will use for each of these you must decide which permissions you want. If you want just yourself to have full access to the files, but every one else only allowed to read and execute them you would use:
chmod 755 this translates into -rwxr-xr-x
by adding the values of the permissions you want to give you are able to decide which to put after the chmod command.
say you want to give yourself read and write permission, but not execute permission, and not let anyone else use your files at all you would use:
chmod 600 this translates into -rw-------
this is often how bin files come. You have read and write access to them, but not execute access. so you have to change the permissions to allow yourself to execute the executable.
you can do any combination of numbers between 0 and 7 for all values
remember:
r = 4
w = 2
x = 1
so:
0 = --- 0 + 0 + 0
1 = --x 0 + 0 + 1
2 = -w- 0+ 2 + 0
3 = -wx 0+ 2 + 1
4 = r-- 4 + 0 + 0
5 = r-x 4 + 0 + 1
6 = rw- 4 + 2 + 0
7 = rwx 4 + 2 + 1
If you are still confused as to how they work, I can pull it straight out of my UNIX workbook and see if they have a better explanation, but that is how it is done.
If you want to install a program you should log in as root and then make sure that at least you have full privilages 700 (-rwx------). So technically, you can use 777 (-rwxrwxrwx) and you will have no problem doing anything you want with the file, but neither will any other user on your system. I wouldn't worry about it since regular users can't navigate into your directories. But if you want to have files that they can't edit in directories they can access, 755 (-rwxr-xr-x) is the minimum you need. If you don't want them to be able to even use or see their contents 700 is needed.
Hope that explains it for yah. Any more questions, I would be glad to take a crack at an answer.
Hi! One more *nix trik.
Wona know what is directory bigest by size ?
Try this (need root privelegy)
var 19597763
services 11947106
home 3646766
proc 921517
usr 832543
root 128285
tmp 77067
lib 69601
sbin 8596
boot 8580
bin 5068
etc 3306
opt 1578
srv 898
dev 281
mnt 0
media 0
This print the list of directories names and sizes sorted by this size. Root's privelegies need for access for every subdirectory on your host
Just change
cd "path" ;
to absolute path you want, and repeat this trick with other directory. Don't foget about ";" Without quotas is up it may be usefull in a /home directory to find voracious users
PS Sorry if I have language mistakes, English is not my native.
Wona know what is directory bigest by size ?
Try this (need root privelegy)
- Code: Select all
#cd /; du -sx `ls -l | grep ^d | awk '{ print($8) }' | grep -v ^[.]*$` | sort -rn | awk '{print($2, $1)}
var 19597763
services 11947106
home 3646766
proc 921517
usr 832543
root 128285
tmp 77067
lib 69601
sbin 8596
boot 8580
bin 5068
etc 3306
opt 1578
srv 898
dev 281
mnt 0
media 0
This print the list of directories names and sizes sorted by this size. Root's privelegies need for access for every subdirectory on your host
Just change
cd "path" ;
to absolute path you want, and repeat this trick with other directory. Don't foget about ";" Without quotas is up it may be usefull in a /home directory to find voracious users
PS Sorry if I have language mistakes, English is not my native.
/* UNIX is user friendly, it's just picky about who its friends are */
just a notification
its not only "tar filename" that you must type ist actuly
"tar xvfz filename"
example
and
"ps x" noth just ps
ps x shows the user processes
just ps is a difrend information
greets Dj_baby
its not only "tar filename" that you must type ist actuly
"tar xvfz filename"
example
- Code: Select all
shell:~# tar zlib-1.2.1.tar.gz
tar: Old option `b' requires an argument.
Try `tar --help' for more information.
shell:~# tar xvfz zlib-1.2.1.tar.gz
zlib-1.2.1/
zlib-1.2.1/adler32.c
zlib-1.2.1/algorithm.txt
zlib-1.2.1/amiga/
.......
shell:~#
and
"ps x" noth just ps
ps x shows the user processes
just ps is a difrend information
greets Dj_baby
16 posts
• Page 1 of 2 • 1, 2
Return to Other Operating Systems
Who is online
Users browsing this forum: No registered users and 6 guests