UNIX and LINUX Commands
UNIX and LINUX Commands
(7 Chapters)
-Shriram K Vasudevan
[email protected]
• To delete (remove) a
file, use the rm
command.
% rm tempfile.txt
• r (or -), indicates read permission (or otherwise), that is, the presence or absence of permission to
read and copy the file
• w (or -), indicates write permission (or otherwise), that is, the permission (or otherwise) to change
a file
• x (or -), indicates execution permission (or otherwise), that is, the permission to execute a file,
where appropriate
• w means that users may delete files from the directory or move files into it;
• x means the right to access files in the directory. This implies that you may read files in the
directory provided you have read permission on the individual files.
• For example, to remove read write and execute permissions on the file
biglist for the group and others, type
% chmod go-rwx biglist
• This will leave the other permissions unaffected.
• To give read and write permissions on the file biglist to all,
% chmod a+rw biglist
NOTE that you can only kill process which are created by yourself. A
Administrator can almost kill 95-98% process. But some process can
not be killed, such as VDU Process.
3+2
5 shri@ubuntu:~$ cat > file1.txt
quit 1+2
quit
shri@ubuntu:~$ bc
bc 1.06.94
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation,
shri@ubuntu:~$ bc file1.txt
Inc.
This is free software with ABSOLUTELY NO WARRANTY.
bc 1.06.94
For details type `warranty'. Copyright 1991-1994, 1997, 1998, 2000, 2004,
9*2
2006 Free Software Foundation, Inc.
18 This is free software with ABSOLUTELY NO
9+2
WARRANTY.
11 For details type `warranty'.
10-10 3
0
shri@ubuntu:~$
Quit - Will take you out of the calculator.
shri@ubuntu:~$ jobs
[1]+ Running gedit file1.txt &
shri@ubuntu:~$ bg
bash: bg: job 1 already in background
shri@ubuntu:~$
$chattr +a file1.txt
$chattr: Operation not permitted while setting flags on file1.tx
SYNTAX:
The Syntax is chown [options] newowner filename/directoryname
The owner of the ‘file1.txt' file is shri, Change to new user root.
-rw-r--r-- 1 shri shri 12 2010-03-30 02:34 file1.txt
shri@ubuntu:~$ chown root file1.txt
chown: changing ownership of `file1.txt': Operation not permitted
• df COMMAND:
df command is used to report how much free disk space is available
for each mount you have. The first column show the name of the disk
• date command partition as it appears in the /dev directory. Subsequent columns show
total space, blocks allocated and blocks available.
date shri@ubuntu:~$ df
Filesystem 1K-blocks Used Available Use% Mounted on
• The above command will /dev/sda1 4878132 2476452 2153880 54% /
print udev 254668 224 254444 1% /dev
none 254668 180 254488 1% /dev/shm
Wed Jul 23 10:52:34 IST 2008 none 254668 92 254576 1% /var/run
none 254668 0 254668 0% /var/lock
none 254668 0 254668 0% /lib/init/rw
shri@ubuntu:~$
shri@ubuntu:~$ free
total used free shared buffers cached
Mem: 509336 480580 28756 0 140528 189548
-/+ buffers/cache: 150504 358832
Swap: 281096 48 281048
shri@ubuntu:~$
Typing groups will get u the details of all the available groups in you system.
shri@ubuntu:~$ groups
shri adm dialout cdrom plugdev lpadmin admin sambashare
• hostid COMMAND:
hostid command prints the
numeric identifier or id of the shri@ubuntu:~$ hostname
current host in hexadecimal. UBUNTU
shri@ubuntu:~$
SYNTAX:
The Syntax is
hostid
SYNTAX:
The Syntax is
id
shri@ubuntu:~$ id
uid=1000(shri) gid=1000(shri)
groups=4(adm),20(dialout),24(cdrom),46(plugdev),104(lpadmin),115(ad
min),120(sambashare),1000(shri)
• IFCONFIG
• ifconfig command displays information about the
network interfaces attached to the system and also
used to configure the network interface.