alias

Create an alias to display all files in the current directory. unalias cancels the alias. Example: $ls #Display all files and directory in the current directory (note the format). $ls –al #Notice on the differences. $alias ls='ls -al' #Create an alias to display all files in the current directory. $ls #Execute the ls command alias. $unalias ls #Un-alias the ls command.

at
Execute a command at a specified time. Example: $ls –al > testjob #Save ‘ls –al’ output into the testlsal file. $echo ‘cp testjob testjob2’ > jobrun #Write a program to copy file and name it jobrun. $chmod 700 jobrun #Give read, write, and execute access permission to owner. $date #Check the date – assuming the time is 10:25. $at –f jobrun 10:30 #Schedule to run the job after 5 minutes. $ls –l testjob* #After 5 minutes, you should get the copy of your file.

cal
Display the calendar of the current month $cal #Display the current month calendar. $cal 2003 # Display the calendar of the year 2003

cat
Display one or more files. Example: $touch test #Create a file named test. $ls –al > test #Copy the output of ‘ls –al’ command into the test file. $cat -n test #Display the test file with numbers in ascending order in front of each line.

cd
Change the current directory. Example: $cd #Change the current directory to the user default home directory. $cd /u01/app/oracle/product/9.1.3 #Change the current directory to /u01/app/oracle/product/9.1.3

chggrp
Change group of the named file or directory. Example: $su root #su to root. $ls –al > test #Write ‘ls –al’ output into the test file. $ls –l test #Display all information about the test file. $chgrp oracle test #Change the group ownership of the test file. $ls –l test #Display again the test file information using the long list format (-l)

chmod
Set file access permissions. Example: $ls –al > test #Write ‘ls –al’ output into the test file. $ls –l test #Note on the test file access permissions. $chmod ugo+rwx test #Give read, write, and execute access to owner, group and other users. $ls –l test #Note on the test file access permissions. $chmod u+rw,g+r test #Give read and write access to owner, read access to group, and nothing to group $ls –l test #Note on the test file access permissions.

chown
Change the owner of a file or directory. Example:

$ls –l test #Note that who owns the file. $cmp testlsal testlsal #compare the testlsal file with itself. $ls –l test #Note that who owns the file. echo Echo argument./copydir #Check to see your file was copied. $echo $GLOBALVAR #Display or echo the content of your global variable. chsh Change the Unix shell you log into.Z appended to the filename.To copy a directory including its contents to a new directory. -r . $clear #Clear the screen. Only the prompt is displayed./copydir #Repeat this and see the difference. $ls –al > test #Write ‘ls –al’ output into the test file. cmp Compares files. $cp -r . $ls –l testcompress #Check the file size. $export GLOBALVAR #Export the value. $mkdir copydir2 #Create another directory. $cmp testlsal testlsl #compare the testlsal file with the testlsl file. $chown oracle test #Give the ownership of test file to oracle user. -i . Example: $ls –al #Display all files’ name and directories in the current folder.$su root #su to root. Example: $ls –al > testcopy #Save ‘ls –al’ output into the testcopy file.Ask before updating a file or directory that exists in the destination with the same name. $chsh –s /bin/ksh #Change the current user shell to the korn shell. date List current date and time ./copydir2 #Check to see your file(s) was/were copied. clear Clears the display. $more testcompress #Check the compress file. $ls –l testcompress #Check the file size. $ls –l > testlsl #Save ‘ls –l’ output into the testlsl file. cp The cp command allows you to copy files to new files. $cp -i testcopy . $ls –al ./copydir #Copy the testcopy file into the copydir directory. $ls –al . recursive. $mkdir copydir #Create a copy directory.’ $GLOBLVAR=’my 2nd test’ #Define a Global variable and assign a value to it. $compress –v testcompress #Compress the file and display compress messages (-v). Example: $echo ‘this statement’ #Display or echo ‘this statement. $cp -i testcopy . $chsh –l #List all of the installed shells in your machine. compress Compress the named file. $uncompress testcompress #Uncompress the file. Example: $ls –al > testcompress #Save ‘ls –al’ output into the testlsal file. The compressed file gets . or copy files and directories to new directories./copydir/* ./copydir2 #Copy all the files from the copydir directory to the copydir2 directory. Example: $ls –al > testlsal #Save ‘ls –al’ output into the testlsal file.

. $gunzip testcompress #Uncompress the file.176 #Copy a file from one machine to anothers.Shows counts for all files encountered.. Example: $du –k /u03/app/oracle #Display disk space used in the /u03/app/oracle directory by directories.txt /u03/oradata/myfile. $gzip testcompress #Compress the testcompressfile. $ls –l > testlsl #Save ‘ls –l’ output into the testlsl file. grep Searchs for a string in a file. -a .204.Example: $date #Display time on the output device.. df Shows disk space available on the system (-k Use 1024 byte blocks instead of the default 512). ftp FTP to a site (or IP address) Example: ftp 205. $more testdate #Display the testdate content.txt fpt> put myfile. $echo ‘Date is in top’ >> testdate #Append the ‘Date is in top’ message in the testdate file.. diff Display the differences between two text files.23. jobs Display active processes. Example: $ls –al > testlsal #Save ‘ls –al’ output into the testlsal file. #copy or ftp file from one server to another using the URL address. $more testcompress #Check the compress file.. $date > testdate #Write date on the created testdate file.txt fpt> bye /opt/sfw/bin/wget http://. $ls –l testcompress #Check the file size. gzip Compress a file. $diff testlsal testlsl #compare the testlsal file with the testlsl file. -k . Example: $ps –ef|grep ora_ #Show only those process that start with ora_ $ls –al |grep oracle #Display all the lines that has oracle word in it. ftp> get myfile. not only directories.Use 1024 byte blocks instead of the default 512. $ls –l testcompress #Check the file size. $du –ak /u03/app/oracle #Display disk space used in the /u03/app/oracle directory by files and directories. Example: $df –k #Display all space available on the system.. $more testdate #Display the testdate file. $diff testlsal testlsal #compare the testlsal file with itself. du Display how much disk space is being used by directories. Example: $jobs #Show the list active jobs.txt /u05/oradata/myfile. Example: $ls –al > testcompress #Save ‘ls –al’ output into the testlsal file.

ls -a (Displays hidden files). more View a file.0.ls Show files in the current directory ls. ping Ping an IP address. ls -l (Displays the file details). $mkdir movedir #Create the movedir directory. $rmdir userdata #Remove the directory. Enter space key to go to next page.. $mkdir –i userdata #Make a directory called userdata and prompt if exist. Prompt if it is duplicate. Example: $ps –ef|grep ora_ #Display all the processes that start with ora_ pwd What is the current directory. make Compile a source code. Example: $cd /u03/oradata #Change the directory to the /u03/oradata directory.)). Example: $ls #Show all files and directories. $ls –al #Check that the directory was created. $ls –al #Display all files and directories plus the hidden files. passwd Change password./movedir #Check to see your file was moved. $mv -i testmove . Example: $ls –al > testmove #Save ‘ls –al’ output into the testmove file. (hidden files in UNIX begin with a dot (. mv Rename or move a file. the current directory and parent directory entries (.0. Example: $ping mymachine $ping 127. ps Display processes status. -i parameter will make the system prompt you before deleting a file or directory. man Read the help man command Example: $man cp #Help information for ‘cp’ command. #Ping using ip address. $ls –al . Example: $make your_source_program #Compile your source program. Example: .1 #Ping using dsn name. Example: $passwd #Change the current password to the new password. $ls –l #Show all files and directories in long format./movedir #Move the testmove file into the movedir directory. and . Example: $more testcopy $Display a file and pause. respectively). mkdir Create a directory.

$rm test_tar #Remove the test_tar file.. $ls –al >> test_tar #Append the output again. rmdir Remove a directory. Example: $ls –al > testtail #Save ‘ls –al’ output into a file named ‘testtail. $ls –l test_tar #Check the size. $ls –al >> test_tar #Append the output one more time. $ls –al >> testtail #Append the output one more time.tar #Un-tar the test_tar.tar test_tar #Create a tar file and name it test_tar. $ls –l test_tar #Notice that the file is back. telnet Connect to a server by hostname (using dns) or IP address. whereis Locate the binary. tail Show last lines of a file.. . $cd myfolder #Change the current folder to the new created folder.. Examples.12 #Telnet to a server using IP address. Example: $ls –al > testremove $ls –l testremove $rm testremove $ls –l testremove #Save ‘ls –al’ output into the testremove file. May be 3 more times. $cd .’ $cd / #Change the directory to root. $cat –n testtail #Get a feel that how big your file is now (-n option will print the line number). #Check again to see the testremove file exists.143. it must be empty. source. Example: $ls –al > test_tar #Save ‘ls –al’ output into a file named ‘test_tar. $telnet hostname #Telnet to a server using dns hostname. Example: $cd /u03 #Change directory to /u03 $mkdir myfolder #Create the myfolder directory in the current folder.55. $tail -5 testtail #Print only the last 5 lines of the testtail file. do the above step number of times. who / Who am i . $whereis findme #Find the created file. do the above step number of times. $df –k > myfirstfile #Create a file. $tar –xvf test_tar.tar file.tar. $tar –cvf test_tar. #Check the testremove file exists. $ls –l test_tar* #Check to see that the tar file was created (-c option will create tar file). #Go back to /u03 $rmdir myfolder #Notice that when you remove the directory. $rmdir –r myfolder #Use r parameter that to remove files or directories recursively. tar Archive files. rm Delete/remove a file. Example: $telnet 155. . $ls –al >> testtail #Append the output again. $ls –al > findme #Save ‘ls –al’ output into a file named ‘findme. #Remove the file. and manual page files. May be 3 more times.$pwd #Display the current directory name.

Who are loged in? Example: $who #Display all users that are loged in. . $zip test_zip #Compress to zip for IBM files. $w #Display all users that are loged in and what they doing. zip Compress to zip for IBM files. $whoami #Display who am I. $id #Display who am I. Example: $ls –al > test_zip #Save ‘ls –al’ output into a file named ‘test_zip’.

Sign up to vote on this title
UsefulNot useful