Assignment - 1 (Unix)
Assignment - 1 (Unix)
1. Tree structure
cd ~
mkdir training
cd ~/training
mkdir level1
cd ~/training
mkdir level2
cd ~/training
mkdir cep
cd ~/training/level1
mkdir sdp
cd ~/training/level1
mkdir re
cd ~/training/level1
mkdir se
To reach the home directory from the subdirectory ‘se’ in one step
cd or cd ~
2. cp -r /dir1 /dir2
cp copy command
-r recursive, copies all the sub-directories.
3. A person must have write permission to send a message and read permission to read a
message.So through ls - l command you can check your permissions,if you have write
permissions then you can send the message.
5. date +%T
6. date “+%Y-%m-%d”
or
date +%F
7. touch chapa chapb chapc chapd chape chapA chapB chapC chapD chapE chap01 chap02
chap03 chap04 chap05 chap11 chap12 chap13 chap14 chap15
8. find . -name "*[a-z]"
15. sleep command suspands program execution for a specified period of time. The sleep
instruction suspends the calling process for at least the specified number of seconds (the
default), minutes, hours or days.
sleep number [suffix]
Where number may be any integer or floating point number, and suffix is an optional. suffix to
indicate the time period.
for eg -
s(seconds)
m(minutes)
h(hours)
d(days)
Examples
Sleep 5
Causes the current terminal session to wait 5 seconds. The default unit is seconds.
Sleep 5h
Causes the current terminal session to wait 5 hours.
also,sleep 5h30m and sleep 5h 30m are illegal since sleep takes only one value and unit as
argument. However, sleep 5.5h is allowed.
To start five jobs in the background, each one sleeping for 10 minutes-
16. ps –e or ps –A