to practice using the database, use 'cd /tmp'
cat > mylife creat file name "mylife". Press Enter every line. To end press and hold Ctrl-D
ls mylife to display file call "mylife"
ls will display all file accept file which start using dot (.)
ls -a Will display all files including files started with dot (.)/ hidden file, ex: .profile
more myfile display the content of "mylife" file
head filename to see the first line of the file
tail filename to see the last ten lines of the file
head -25 filename to see the first 25 lines of the file
mv myfile filname to change the name file from 'myfile' to 'filename'
mv -I mylife filename to change the name file from 'myfile' to 'filename' but not overwrite another file (there's another file call 'filename')
mv 'file' 'directory' to move any file to any directory
mv 'directory'/'file' . to move back the 'file' from 'directory' to your working directory
mv -I myfile /home/leslie/footfile s.d.a just incase there's another file called 'mylife'
mv new/* old move all files from directory new to directory old
cp mylife mylife2 to make a new copy of myife called 'mylife2'
cp -I mylife mylife2 s.d.a just incase there's another file called 'mylife2'
cp 'file' 'directory' to copy a file to any directory
cp -r mydir mydir2 to copy a directory to a new directory, including the contain
cp new/* old copy all files from directory new to directory old
rm mylife to remove file 'mylife'
rm -I mylife s.d.a. with verification prompt for permission before deleting file
rmdir 'directory' to remove an empty directory
rm -rf 'directory' to remove a directory including all the contain
rm new/* remove all files from directory new
ll to see the complete long listing of file containing in the directory
diff test1 test2 to see the differences between those two files
cat test2>>test1 to add the contain of test2 to test1
pwd to display the absolute path
ls .. to list all files in the directory
lsf to list the contain of directory, but differences directory with (/) in the end of the name
mkdir project to make directory
mkdir project/myfile to make file 'myfile' in directory 'project'
cd or cd.. back to various directory
cd ../.. back to two various directory
cd ../../.. back to three various directory
find . -name 'd*' ( -name ) tells find to find a filename that started with "d", in current directory and all the sub
directories (the dot (.))
find /home/leslie -newer mylife ( -newer ) tells find to find all files that has been modified after 'mylife' file.
find -name '*.tmp' -exec {} \; after find all files with ".tmp" , run the -exec command to dellete them. {} represent the files
found with the 'find' command. ' \: ' ends the exec string
find /tmp \( ! - user leslie \) find all files in /tmp that aren't owned by leslie
find / \( -type d -a -user leslie \) to find all directories '-type d' + and operator ( -a ) in / that are owned by leslie ( -user leslie)
find / \( -name a.out -o -name '*.o' \) -atime +7 -exec rm {} \;
find file name "a.out" or (-o) all files that ended with ".o" which haven’t been accessed for
a week ( -atime +7) then delete them
cal to display the English calendar
cal 2 1998 will display a calendar for February 1998 AD
grep ' word1, word2' filename will display all lines which contain "word1, word2" in a file
grep 'aku' myfile will display all lines which contain words 'aku' in file 'myfile'
whoami ; date semicolon (;) will connect two or more commands
/keysh aou'll be in $ shell and will display a Key Shell Softkey at the bottom of the screen.
Each label corresponds to a key F1 to F8
/exit will goback to previous shell
who > filename command who will give results and (>) will redirect the standar output to "filename"
wc -l filename (wc) wordcount will count how many lines in the file
sort < filename will sort the contain of a filename and display them on screen
sort <> filename2 will sort the contain of a filename1 and store them in filename2
set -o vi to use the vi editor temporarily
set +o vi to turn off the vi editing mode
vi filename start using vi in a file
history -3 to display the last 3 command
echo "Hai" will display 'Hai'
nama1="yudhi" assigning 'yudhi' into variabel 'nama1'
nama1=${nama2} the contain of nama1 will be assigned to variabel nama2
echo $nama1 will display the contain of variabel nama1
expr 1+2 the output will be 3
expr $angka1 + 3 will added the contain of variabel 'angka1' to 3
UNIX SCRIPT ON CA DAILY ACTIVITY
ftp [servername] file transfer protocol , to GET [filename] or MGET [files] from other server to local server. End session with BYE
file [filename] to know the specification of current file
ln to make a link from a file in other directory so it can be executed from current directory (SEE MANUAL)
remsh to access other server (remote access) and do specific action in the target server (SEE MANUAL)
rcp to run 'cp' from remote server of a file in other server (SEE MANUAL)
cmviewcl -v to display the status of nodes and package (SEE MANUAL)
bdf to display the space status of current server
cmmodpkg -d/-e -n [node] -v [package] to disable/enable the status of current node (SEE MANUAL) Run the command in current server !
cmrunpkg to run/down the status of current package (SEE MANUAL)
cmhaltpkg to halt/stop the status of current package (SEE MANUAL)
haltapp to reset/stop all the running application on CA server. Run the command from /etc in ivMAC
startapp to run all the stopping application on CA server. Run the command from /etc in ivMAC
at -f [file] -t [yymmddhhmm] to schedule files to be executed on specific time
sed -e 's/[char1]/[char2]/g' [file1] stream editor : replace every 'char1' with 'char2' in 'file1'
Thursday, July 17, 2008
Unix Commands
Posted by Sumedh at 9:57 AM
Labels: Fresher Preparation Material
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment