Professional Documents
Culture Documents
Unix Commands: Files and Directories
Unix Commands: Files and Directories
cat <filename>
- To create a File
CTRL-D
- To save a File
ls
lsf
ll
ls -a
In Unix file name is "Case sensitive" 'Money' and 'moneY' are treated as two files
more <filename>
Press 'SPACE' to viwe content of longer file. Press 'Q' to quit or when
finished
head <filename>
tail <filename>
lpstat -t
mv </path1> </path2>
mv -i </path1> </path2>
UNIX COMMANDS
Page 1 of 5
cp <filename1> <filename2>
cp </path1> </path2>
cp -i </path1> </path2>
cp -i <filename1> <filename2>
rm <filename>
rmdir <dir>
rm -i <filename>
pwd
mkdir <dir1>/old
cd
cd <path>
grep <word> <file1> <file2> <file3> - To list the string contains <word> in multiple
files
cal
cal 5 2010
- To remove a file
- To remove a directory
UNIX COMMANDS
Page 2 of 5
dd
ESC
:q!
:w
:wq
:W <file1>
:w! <file1>
:r <file1>
:!<command>
ftp <hostname>
UNIX COMMANDS
Page 3 of 5
get <remote file> <local file> - To transfer file from remote host to local host
<remote file> is the path of file to be transferred.
<local file> is the path of file where to be Transferred.
put
ps -ef
kill <PID>
kill -9 <pid>
ps ef | grep tp
ps ef | grep sap
ps ef | grep ora
BDF
- View Overall Filesystems
bdf . (Checking the particular filesystem you are currently in)
PS
ps eaf | grep dw
chmod
chown
chgrp
ls
- Listing files in a particular directories
ls -al (List of all Files)
ls -lrt (Listing the filenames with respect to Timestamp)
pwd
rm
- Remove file
- To stop a process
UNIX COMMANDS
Page 4 of 5
rm -rf filename
rm -i filename
(Confirm Delete)
(Will prompt before deleting)
clear
UNIX COMMANDS
Page 5 of 5