Unix commands Man ual command.

man man This is help command, and will explains you about online manual pages you can also use man in conjunction with any command to learn more about that command for example. • man ls will explain about the ls command and how you can use it. • man -k pattern command will search for the pattern in given command.

Banner command.
banner prints characters in a sort of ascii art poster, for example to print wait in big letters. I will type banner wait at unix command line or in my script. This is how it will look.
# # # # # # # ## # ## ## # # # ## # # # # # # # ##### # # # # #

# # ###### # # # #

Cal command
cal command will print the calander on current month by default. If you want to print calander of august of 1965. That's eightht month of 1965. cal 8 1965 will print following results.
August 1965 S M Tu W Th F S 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

Clear command
clear command clears the screen and puts cursor at beginning of first line.

Calendar command
calendar command reads your calendar file and displays only lines with current day. For example in your calendar file if you have this
12/20 1/15 1/20 Test new software. Test newly developed 3270 product. Install memory on HP 9000 machine.

On dec 20th the first line will be displayed. you can use this command with your crontab file or in your login files.

Nohup command.
nohup command if added in front of any command will continue running the command or process even if you shut down your terminal or close your session to machine. For exmaple, if I want to run a job that takes lot of time and must be run from terminal and is called update_entries_tonight . nohup update_entries_tonight will run the job even if terminal is shut down in middle of this job.

mv. More command. head filename by default will display the first 10 lines of a file. Mkdir command. . /u0/ssb/sandeep is output for the command when I use pwd in /u0/ssb/sandeep directory. Cd command. ls -Rwill lists all the files and files in the all the directories. Head command.tail. this command has many options.mkdir .more. group. pwd means print working directory. cd sandeep will change directory from current directory to sandeep directory. If you want last 50 lines then you can use tail -50 filename. pwd. Tail command. 2 (invalid options) (good for scripts) File Management commands. cat. Pwd command. i.txt cat command displays the contents of a file here cal.cd. newer files bring first.txt on screen (or standard out). wc. ls -Fxwill list files and directory names will be followed by slash. Cat command cat cal. rmdir.rm. • -s will return only the codes: 0 (a terminal). ls -lt will list all files names based on the time of creation. ls -a will list all the files including hidden files that start with .Tty command Tty command will display your terminal. tail filename by default will display the last 10 lines of a file. You can then use cd sandeep to change the directory to this new directory. So you can use more filename .head.ls. ls -R | more will list all the files and files in all the directories. cp. mkdir sandeep will create new directory. Ls command ls command is most widely used command and it displays the contents of directory. one page at a time. file. rcp. permissions. etc in long format. more command will display a page at a time and then wait for input which is spacebar.e. 1 (not a terminal). options • • • • • • • ls will list all the files in your home directory. Use pwd to check your current directory and ls to see if sandeep directory is there or not. Syntax is tty options Options • -l will print the synchronous line number. For example if you have a file which is 500 lines and you want to read it all. ls -l will list all the file names. recursively. here sandeep directory is created. pwd command will print your home directory on screen. ln. If you want first 50 lines you can use head -50 filename or for 37 lines head -37 filename and so forth.

mv * /usr/bajwa/ will move all the files in current directory to /usr/bajwa directory. Options • • • wc -l filename will print total number of lines in a file. -r recursively copy a directory and its files. File command displays about the contents of a given file.txt cal. File command.doc file which is a binariy file in microsoft word.Wc command wc command counts the characters. For more infor type man rcp at command line. Instead of copying you can also make links to existing files using ln command. To use it type file filename. mv -f oldfile newfile will force the rename even if target file exists. wc -w filename will print total number of words in a file. wc -c filename will print total number of characters in a file. duplicating the tree structure. If you want to create a link to a file called coolfile in /usr/local/bin directory then you can . I will get file resume. whether it is a text (Ascii) or binary file. mv -i oldfile newfile for confirmation prompt.doc: data file cal.doc resume1.txt: ascii text Cp command. words or lines in a file depending upon the option. For example you are on a unix system that is called Cheetah and want to copy a file which is in current directory to a system that is called lion in /usr/john/ directory then you can use rcp command rcp filename lion:/usr/john You will also need permissions between the two machines. Mv command. If I want to copy a file named oldfile in a current directory to a file named newfile in a current directory.txt which has ascii characters about calander of current month and I have resume1. Ln command. mv command is used to move a file from one directory to another directory or to rename a file. rcp command will copy files between two unix systems and works just like cp command (-p and -i options too). Rcp command. For example I have cal. -p options preserves the modification time and permissions. cp oldfile newfile If I want to copy oldfile to other directory for example /tmp then cp oldfile /tmp/newfile. Useful options available with cp are -p and -r . Some examples: • • • • mv oldfile newfile will rename oldfile to newfile. cp command copies a file.

Options: • • • rm oldfile will delete file named oldfile.lkdjf not different filetwo contains This this this this this is is is is is first file second line third line different xxxxxxxas. rmdir -s will suppress standard error messages caused by -p. diff command will compare the two files and print out the differences between. rmdir -p will remove directories and any parent directories that are empty. Here I have two ascii text files. Diff command. Contents of fileone are This this this this this is is is is is first file second line third line different as.lkdjf xxxxxxxas. rmdir sandeep is how you use it to remove sandeep directory.enter this command. very dangerous command. ln -f will force the link to occur. Options: • • • • rm -r directory_name will remove all files even if directory is not empty. grep. rm -f option will remove write-protected files without prompting. To delete files use rm command.dircmp.lkdjf Cmp command. Rm command. fileone and file two. cmp command compares the two files. cmp.lkdjf not different diff fileone filetwo will give following output 4c4 < this is different --> this is different as. rmdir command will remove directory or directories if a directory is empty. ln mycoolfile /usr/local/bin/coolfile Some examples: • • • ln -s fileone filetwo will create a symbolic link and can exist across machines. Comparison and Searching diff. find. Rmdir command. ln -n option will not overwrite existing files. For exmaple I have two different files fileone and . rm -r option will delete the entire directory as well as all the subdirectories.

line 4 if I run cmp command on similar files nothing is returned.txt .txt . It can be used to search one or more files to match an expression. to find a pattern in a file. -i ignores uppercase and lowercase distinctions. other associated commands with grep are egrep and fgrep. output of ps command is passed to grep command. 2 if files are inaccessible. return 0 if files are identical./rmt. -s command can be used to return exit codes. ops dxi ops ops ops dxi ops dxi ops ops ssb pjk • • • • 12964 12974 12941 12847 12894 13067 13046 12956 12965 12989 13069 27049 25853 15640 25688 25812 25834 27253 25761 13078 25737 25778 26758 3353 0 0 0 0 0 2 0 0 0 0 2 0 16:12:24 16:12:25 16:12:21 16:11:59 16:12:12 16:12:48 16:12:44 16:12:23 16:12:24 16:12:28 16:12:49 15:20:23 ttyAE/AAES ttyAH/AAHP ttyAE/AAEt ttyAH/AAH6 ttyAE/AAEX ttyAE/ABEY ttyAE/AAE0 ttyAG/AAG+ ttyAE/AAEp ttyAH/AAHv ttyAH/AAHs ? 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 0:00 sleep 60 sleep 60 sleep 60 sleep 60 sleep 60 sleep 1 sleep 60 sleep 60 sleep 60 sleep 60 grep sleep sleep 3600 Options: -b option will precede each line with its block number./third. -c option will only print the count of matched lines. ps -ef | grep sleep will display all the sleep processes running in the system as follows. egrep typically runs faster.txt .filetwo./four./dohazaar.txt . If i have two directories in my home directory named dirone and dirtwo and each has 5-10 files in it. You can use it to find processes running on system. This following command prints a message 'no changes' if files are same cmp -s fileone file1 && echo 'no changes' .txt Grep Command grep command is the most useful search command. etc.txt . 1 if files are different./cal. It can also be used in conjunction with other commands as in this following example. i.txt ./test. -l lists filenames but not matched lines.txt . here it means search all processes in system and find the pattern sleep. ./fourth.e. no changes Dircmp Command. Then dircmp dirone dirtwo will return this Dec 9 16:06 1997 dirone only and dirtwo only Page 1 . dircmp command compares two directories./junk./te. cmp fileone filetwo will give me fileone filetwo differ: char 80.txt . for more information type man egrep or man fgrep in your system.

Find descends directory tree beginning at each pathname and finds the files that meet the specified conditions.your.sed. -ctime +n or -n will find that were changed +n -n or n days ago. Cut command. Options: • • • -c list cut the column positions identified in list. Text processing cut. conditions of find • • • • • • • • • -atime +n |-n| n will find files that were last accessed more than n or less than -n days or n days. -print print or list to standard output (screen).awk. You can use it with cpio command. Very useful condition. -depth descend the directory structure.vi. -name pattern find the pattern. -perm nnnfind files whole permission flags match octal number nnn. p fifo or named pipe. Some Examples: find $HOME -print will lists all files in your home directory. Option -c is for columns and -f for fields. l symbolic link. will remove all empty files on system. -size n find files that contain n blocks. It is entered as cut options [files] for example if a file named testfile contains this is firstline this is secondline this is thirdline Examples: cut -c1. C could be b or block. Find command is a extremely useful command. run the Unix command on each file matched by find. -exec commad {} \. -f list will cut the fields identified in list. group or all. Here are some examples.Find command. find / -type d -name 'man*' -print will list all manpage directories. find /work -name chapter1 -print will list all files named chapter1 in /work directory. you can search for any file anywhere using this command provided that file and directory you are searching has read write attributes set to you . . working on actual files first and then directories. d directory.paste. find / -size 0 -ok rm {} \.4 testfile will print this to standard output (screen) ts ts ts It is printing columns 1 and 4 of this file which contains t and s (part of this). -type c Find file whole type is c. uniq. c Character special file. cut command selects a list of columns or fields from one or more files. or f plain file. sort. -s could be used with -f to suppress lines without delimiters.

for example if a file named testfile contains this is firstline and a file named testfile2 contains this is testfile2 then running this command paste testfile testfile2 > outputfile will put this into outputfile this is firstline this is testfile2 it contains contents of both files in columns. in alphabetical order.will list users in two columns. uniq command removes duplicate adjacent lines from sorted file while sending one copy of each second file. Sort command. -i ignores non-printing characters. -s merge subsequent lines from one file. who | paste . -r reverse the order of sort. -ofile put output in a file. -u identical lines in input file apear only one time in output. -d ignores punctuation. paste command merge the lines of one or more files into vertical columns separated by a tab. +m[-m] skips n fields before sorting. sort command sort the lines of a file or files. Uniq command.Paste Command. for example if you have a file named testfile with these contents zzz aaa 1234 yuer wer qww wwe Then running sort testfile will give us output of 1234 aaa qww wer wwe yuer zzz • • • • • • • • • Options: -b ignores leading spaces and tabs. and sort upto field position m. -c checks whether files are already sorted. Examples . Options: • • -d'char' separate columns with char instead of a tab.. -n sorts in arithmetic order.

Here the output of command df -t is being passed into awk which is counting the field 1 after pattern "total" appears. Sed command. To edit a file type vi filename vi editor is a default editor of all Unix systems. • -f script Apply the set of instructions from the editing script. Same way if you change $1 to $4 it will accumulate and display the addition of field 4 which is used space. vt100 emulation works good if you are logged in using pc. you can enter your sed commands in a file and then using -f option edit your text file. for more information about sed. . o I inserts text at the curson o A appends text at the end of the line. Once you are done typing then to be in command mode where you can write/search/ you need to hit :w filename to write and in case you are done writing and want to exit :w! will write and exit. Awk and Nawk command. -d print duplicate lines once. for more information about awk and nawk command in your system enter man awk or man nawk. • -n suppress default output. Make sure that your terminal has correct settings. Options: • • • -c print each line once. Vi editor. but no unique lines. etc.sort names | uniq -d will show which lines appear more than once in names file. counting instances of each. vi command launches a vi sual editor. It has several modes. o O open a new line of text above the curson. Although mostly used for text processing. -u print only unique lines. It works as sed [options] files options: • -e 'instruction' Apply the editing instruction to the files. enter man sed at command line in your system. Examples: df -t | awk 'BEGIN {tot=0} $2 == "total" {tot=tot+$1} END {print (tot*512)/1000000}' Will give total space in your system in megabytes. sed command launches a stream line editor which you can use at command line. options: • i for insert mode. o a appends text after cursor. In order to write characters you will need to hit i to be in insert mode and then start typing. awk is more like a scripting language builtin on all unix systems. Here are some examples which are connected with other commands.

Shells.• • • o o open a new line of text below the curson. then entering • bg at command line will put this job in background. Shell is command line userinterface to Unix operating system. o $ to move to the end of line. Common features among all shells are job control. echo. o nyy copy n number of lines to buffer. o <escape> to invoke command mode from insert mode. o J join a line with the one below it. csh. ksh. example: • find / -name *. o :!sh to run unix commands. o x to delete a single character.line. like ksh and csh are popular shells on unix although there are 5 or 6 different shells available but I will only be discussing ksh and csh as well as sh. test. User have an option of picking an interface on Unix such as ksh.Z -print > compressedfiles then after entering this command hitting • <control z> key will suspend this job. Shell and programming Shell programming. Unix was written in C language and thus c language is integral part of unix and available on all versions. csh. o dd to delete an entire line o ndd to delete n number of lines. o b to move backwards to next word. o w to move forward to next word. o P to paste text from buffer. /string to search string in file. Shell programming is used to automate many tasks. for example if I am running a processes which is searching the whole system for . entering • fg will put this job in foreground. o d$ to delete from cursor to end of line. Shell programming concepts and commands. o yy to copy a line to buffer. Entering • jobs at command line will show me all my concurrent jobs that are running. Other common features . o 1G to go to the first line in file.bourne shell.cc compiler. n to search for next occurence of string. o G to go to last line in file. Shell programming is integral part of Unix operating systems.Z files and output is directed to a file named compressedfiles. these are called shells(interface). o :%s/stringA/stringb /g to replace stringA with stringB in whole file..sleep. or default sh. : for command mode. Shell programming is not a programming language in the truest sense of word since it is not compiled but rather an interpreted language.

>> filename will append at the end of a file called filename.. " " partial quote for variables.who. . • function name {commands. • for x[in list] do commands done is syntax for for do loop. or redirect output. ' ' full quote for variables. & at the end of command will run command in background. [] will match any characters enclosed. . break break from loop statements. | pipe output.. ls execute one after another. o let i=i+1 will work as a counter with i incrementing each time this statement is encountered. find command with cpio. sh or Bourne shell is default shell of Unix operating systems and is the most simplest shell in Unix systems. etc.pwd)> logifile will redirect all the output from three commands to a filenamed logfile.} is the syntax of a function which can be called from anywhere in program. Kill pid number will terminate running jobs stop will stop background job. i. () execute in subshell. • (date.e. . i. Examples: • cd. continue Resume a program loop. junk* will match all files with first 4 letters ? will match single characters in a file.e. < will redirect input to a process or commnand. suspend will suspend foreground job. • alias [options] [name[='command']] will let you create your own commands. # begin comment (if #/bin/ksh or csh or sh is entered at first line of script it runs script in that shell) bg background execution. Ksh or Korn shell is widely used shell. • if condition1 then commands1 elif condition2 then commands2 . . Bourne Shell (sh shell). ` ` to run a command inside another command and use its output.. else commands3 fi Ksh shell (Korn).. o alias ll="ls -la" will execute `ls -la` command whenever ll is entered... will separate commands on same line. • sort file | lp will first sort a file and then print it. * will match any characters in a file or directories.o o o o o o o o o o o o o o o o o o o o o > will redirect output from standard out (screen) to file or printer or whatever you like. • let expressions is syntax of let statement. wait will wait for a background job to finish. good for joining commands.

Ftp command (protocol). • -sn set transmission rate to n(e. • -e sends even parity data to remote system • -lline communicate on this device (line=/dev/tty001. most Unix operating systems come with c compiler called cc. BPS) Destination • telno is the telephone number of the modem to connect to. Line command. Echo command echo command in shell programming. rlogin. Cu command. • -d Prints diagnostics. show all responses from remote server.9600. • -g disable filename globbing. • -v verbose on.g 1200.talk. Syntax is cu options destination Options • -bn process lines using n-bit characters (7 or 8). etc) • -n prompts for a telephone number.telnet. cu command is used for communications over a modem or direct line with another Unix system. vacation and write .Csh or C shell csh is second most used shell. test command in shell programming. line command in shell programming. CC compiler (c programming language compiler).ftp. sleep command in shell programming. Test Command. . Since Unix is itself written in C programming language. Communications cu. Sleep command.login. • system is call the system known to uucp. Syntax is ftp options hostname options • -d enable debugging. • -cname Search UUCP's device file and select local area network that matches name. ftp command is used to execute ftp protocol using which files are transferred over two systems. • aadr is an address specific to LAN. • -i turn off interactive prompts.2400.

Syntax is write user tty Storage commands compress uncompress. bin at ftp> prompt will set the transfer to binary. System prompts you to enter userid and password.Z file use uncompress filename command. Rlogin command.rhosts file. Talk command. • -F user will forward mail to user when unable to send mail to mailfile. • -e c will let you use escape character c. type mail -F " " . ASCII or Binary. or an id defined in . talk command is used to invoke talk program available on all unix system which lets two users exchange information back and forth in real time. Syntax is rlogin options host options • -8 will allow 8 bit data to pass. rlogin command is used to log on to remote Unix systems. to disable this feature. Two types of files can be transferred. you must have a login id to be able to transfer the files. tar. syntax for compress command is compress options files Options . which then authenticates the login to a system. to uncompress this filename. instead of same as local host.pack. Practice FTP by ftping to nic. Write command will initiate an interactive conversation with user. syntax is vacation options Options • -d will append the date to the logfile. mt. Telnet command invokes a telnet protocol which lets you log on to different unix. vms or any machine connected over TCP/IP protocol. user must have permissions on both systems as well as same userid. Compress command compresses a file and returns the original file with . IPx protocol or otherwise.funet. Compress command. • -m mailfile will save received messages in mailfile. Syntax is talk userid@hostname Telnet command. login command invokes a login session to a Unix system. vacation command is used when you are out of office. Login command.ftp hostname by default will connect you to the system. • -l logfile will record in the logfile the names of senders who received automatic reply. It returns a mail message to sender announcing that you are on vacation. Syntax is telnet hostname Vacation command.z extension.dump.fi loggin in as anomymous with password being your e-mail address. cpio. instead of 7-bit data. • -l user will let you to login as user to remote host.

-depth -print | cpio -padm /mydir will move a directory tree. -o. o -A append files to an archive (must use with -o). o -o file direct output to a file. o -R ID reassign file ownership and group information to the user's login ID. o -l link files instead of copying. -c write to standard output (do not change files). -i. syntax is uncompress filename.old" -print | cpio -ocvB > /dev/rst8 will backup all *. dump command copies all the files in filesystem that have been changed after a certain date. This information about date is derived from . o -S swap half bytes. o -b swap bytes and half-words. -p • cpio -i [options] [patterns] o cpio -i copy in files who names match selected patterns.Z this uncompresses the compressed file to its original name. -f compress conditionally. o -s swap bytes. -name "*. o -B block input or output using 5120 bytes per record. cpio -p o copy files to another directory on the same system.old files to a tape in /dev/rst8 o cpio -icdv "save"" < /dev/rst8 will restore all files whose name contain "save" o find . Dump command is useful to backup the file systems. o -v print a list of filenames. o -c Read or write header information as Ascii character. o It is used to write to a tape. Options • -c write to standard output without changing files Cpio command. Uncompress file uncompresses a file and return it to its original form. Uncompress command. Words are 4 bytes. o If no pattern is used all files are copied in. cpio -o o Copy out a list of files whose name are given on standard output. o -V print a dot for each file read or written. or to another location on the local machine. -v Print the resulting percentage of reduction for files. o -d create directories as needed. do not prompt before overwriting files. cpio command is useful to backup the file systems. Examples o find . o -r rename files interactively. Its syntax is cpio flags [options] It has three flags. Options o -a reset access times of input files. It copy file archives in from or out to tape or disk.• • • • -bn limit the number of bits in coding to n. It is good for incremental backups.

Pack command. • To display Packed files in a file use pcat command pcat filename..z file. • f place the dump on next argument file instead of tape. Synopsis of tar is tar [options] [file] Examples: tar cvf /dev/rmt/0 /bin /usr/bin creates an archive of /bin and /usr/bin. relative frequency and byte code. The original file is replaced.z ./var/adm/dumpdates and /etc/fstab . r append files to a tape. • -f Force the pack even when disk space isn't saved.tar.'find .Print number of times each byte is used.tar will creates an archive of current directory and store it in file backup. and store on the tape in /dev/rmt0. syntax for HP-UX dump is /usr/sbin/dump [option [argument . tar tvf /dev/rmt0 will list the tape's content in a /dev/rmt0 drive. l print error messages about links not found. Tar copies and restore files to a tape or any storage media. L follow symbolic links. b n use blocking factor of n.z • To unpack a packed file use unpack command as unpack filename. • This example causes the entire file system (/mnt) to be dumped on /dev/rmt/c0t0d0BEST and specifies that the density of the tape is 6250 BPI. pack command compacts each file and combine them together into a filename. 0 option causes entire filesystem to be dumped. tar command creates an archive of files into a single file. • b blocking factor taken into argument. Tar command. x extract files from tape. o /usr/sbin/dump 0df 6250 /dev/rmt/c0t0d0BEST /mnt • for more info type man dump at command line. Options: Mt command . -print' > backup. Syntax is Pack options files Options • . t print the names of files if they are stored on the tape.] filesystem] Options • 0-9 This number is dump level.. v print function letter (x for extraction or a for archive) and name of files. Functions: • • • • • • • • c creates a new tape. • d density of tape default value is 1600. Pcat and unpack will restore packed files to their original form. tar cvf .

It give commands to tape device rather than tape itself. System Status at. • rew Rewind tape. etc. for example if I have a text file with calender in it called cal. finger. • fsf Forward space count files. • fsr Forward space count records. syntax is mt [-t tapename] command [count] mt for HP-UX accept following commands • eof write count EOF marks.txt . chown. chmod command is used to change permissions on a file. • eod Seek to end of data (DDS and QIC drives only). chmod. env.enter> usersloggedin %lt.enter> I will get following output at 8:00 AM 30 are total number of people logged in at this time. As you can see this file has 666 or -rw-rw-rw attributes. • -r jobnumber will remove specified jobs that were previously scheduled.stty. At command. • smk Write count setmarks (DDS drives only). initially when this file will be created the permissions for this file depends upon umask set in your profile files. • -m will send mail to user after job is completed. ejecting. • bss Backward space count setmarks (DDS drives only).date. ls -la cal. • fss Forward space count setmarks (DDS drives only). who.du. df. ps.chgrp.txt -rw-rw-rw1 ssb dxidev 135 Dec 3 16:14 cal. • Examples o mt -t /dev/rmt/0mnb rew will rewind the tape in this device. • -l will report all jobs that are scheduled and their jobnumbers.txt. shutdwon. Options: • -f file will execute commands in a file. So I will first type at 8:00 %lt. o mt -t /dev/rmt/0mnb offl will eject the tape in this device. Chmod command.ruptime. Mt command is BSD command and is seldom found in system V unix versions.crontab. at options time [ddate] [+increment] is syntax of at command. for example if I have a script named usersloggedin which contains. • offl Rewind tape and go offline.Mt command is used for tape and other device functions like rewinding. • bsr Backward space count records. at command along with crontab command is used to schedule jobs. #!/bin/ksh who | wc -l echo "are total number of people logged in at this time. • bsf Backward space count files." and I want to run this script at 8:00 AM.

i. chown command to change ownership of a file or directory to one or more users. Chgrp command. * represents all values. The entry in crontab file will be. if permissions are 755 or 111 101 101 that means rwxr-xr-x or user can read.In this line above I have -rw-rw-rw. like this for example Decimal 644 which is 110 100 100 in binary meand rw-r--r-. You must have permission to run this command by unix Administrator. everyone else can read only. this file was created on December 3 at time16:14 and at the end there is name of this file. Similarly.or user can read. Chown command. chgrp command is used to change the group of a file or directory. chmod 600 filename. • -R will recursively descend through the directory.25 (22:25) on 15th of month. group can read and execute.write this file. chgrp [options] newgroup files is syntax of chgrp. Newgroup is either a group Id or a group name located in /etc/group . Options: • -h will change the group on symbolic links. member of the owner's group can read and write this file and anyone else connected to this system can read and write this file. including subdirectories and symbolic links. All directories have d in front of permissions. Date displays todays date. So if you don't want anyone to see your files or to do anything with it use chmod command and make permissions so that only you can read and write to that file. Learn to read these permissions in binary.e. to use it type date at prompt. group can read only. You must own the file or be a superuser. Syntax is chown options newowner files Options • -h will change the owner on symbolic links. as follows. everyone else can read and execute.This will scheduled the jobs. Minutes 0-59 Hour Day of month month Day of week 1-31 0-23 1-12 0-6 (0 is sunday) so for example you want to schedule a job which runs from script named backup_jobs in /usr/local/bin directory on sunday (day 0) at 11. Jobs are scheduled in five numbers. • -R recursively descend through directory changing group of all files and subdirectories. next ssb is owner of this file dxidev is the group of this file. . 25 22 15 * 0 /usr/local/bin/backup_jobs The * here tells system to run this each month. write and execute. Syntax is crontab file So a create a file with the scheduled jobs as above and then type crontab filename . Date command. Crontab command.. there are 135 bytes in this file. crontab command is used to schedule jobs.meaning respectively that owner can read and write file.

To gracefully bring down a system. Env command. • -r reverse the sort order.Sun Dec 7 14:23:08 EST 1997 is similar to what you should see on screen. • -t sort by uptime. • -gn use a grace-period of n seconds (default is 60). • -k will print allocation in kilobytes. Finger command. • -e will print only the number of free files. df command displays information about mounted filesystems. with no arguments it lists type of all filesystems Du command. PS command ps command is probably the most useful command for systems administrators. shutdown command is used. • -a include user even if they've been idle for more than one hour. options. • -l will report only on local file systems. . ruptime command tells the status of local networked machines. du command displays disk usage. It reports the number of free disk blocks. • -a Lists all processes in system except processes not attached to terminals. It reports information on active processes. • -f Lists a full listing. • -j print process group ID and session ID. Ruptime command. • -l sort by load average. ruptime options options. Typically a Disk block is 512 bytes (or 1/2 Kilobyte). ps options options. syntax is df options name Options • -b will print only the number of free blocks. Shutdown command can only be executed by root. Df command. • -F type will report on an umounted file system specified by type. • -f will report free blocks but not free inodes. • -i sort by number of users. finger command. Shutdown command. env command displays all the variables. • -e Lists all processes in system. • -n will print only the file system name type.

will change your keyname to be backspace key. Who command who command displays information about the current status of system. Options • -a use all options. without options stty reports terminal settings. • -g report current settings. Modes • 0 hang up phone. . who options file Who as default prints login names of users currently logged in. • -H print headings. o 6 stop system then reboot. • -d report expired processes. • n set terminal baud. o 5 stop system. go to firmware mode. • -b Report information about last reboot.• • -ik tell the init command to place system in a state k. -y suppress the default prompt for confirmation. • -p report previously spawned processes. o 1 like s. o s single-user state (default) o 0 shutdown for power-off. but mount multi-user file systems. Stty command stty command sets terminal input output options for the current terminal. • -u report terminal usage. • erase keyname. stty options modes < device options • -a report all options.

Sign up to vote on this title
UsefulNot useful