Professional Documents
Culture Documents
Anika OS File
Anika OS File
OPERATING
1 | OS PRACTICAL FILE
INDEX
Basic commands ------------------------------------------------------- 1
echo ---------------------------------------------------------------------------3
date ---------------------------------------------------------------------------6
hostname ----------------------------------------------------------------13
arch -------------------------------------------------------------------------13
uname ----------------------------------------------------------------------14
uptime ----------------------------------------------------------------------14
who ---------------------------------------------------------------------------14
whoami---------------------------------------------------------------------17
Directory Commands ----------------------------------------------18
pwd ---------------------------------------------------------------------------18
cd ------------------------------------------------------------------------------18
ls -------------------------------------------------------------------------------21
mkdir -----------------------------------------------------------------------24
rmdir -------------------------------------------------------------------------25
rm -r --------------------------------------------------------------------------25
File Commands --------------------------------------------------------26
cat ----------------------------------------------------------------------------26
rm ----------------------------------------------------------------------------27
mv ----------------------------------------------------------------------------28
cp -----------------------------------------------------------------------------28
wc -----------------------------------------------------------------------------31
touch -----------------------------------------------------------------------33
paste ------------------------------------------------------------------------35
sort ---------------------------------------------------------------------------35
cut ----------------------------------------------------------------------------38
wild cards ----------------------------------------------------------------41
1 | OS PRACTICAL FILE
BASIC COMMANDS
➢ echo : echo is a built-in
command in the bash and C shells that
writes its arguments to standard
output.
DIRECTORY COMMANDS
➢ pwd - For printing the current
directory.
➢ cd - Changing directories
18 | O S P R A C T I C A L F I L E
o cd : go to home directory
o cd ~/papers : go to home/user/papers
o cd /dir1/dir2/dir3… : go to directory
(absolute)
19 | O S P R A C T I C A L F I L E
➢ rmdir
o rmdir dirname : deletes the directory
if empty else interrupts to delete files
first
FILE COMMANDS
➢ cat
o cat > filename – Creates new file
( insert content in file)
▪ ctrl+d – to signify end of file
o cat f1 – to display contet of file
o cat f1 f2 – to displays content of
multiple files
o cat -n f1 – to displays with line numbers
26 | O S P R A C T I C A L F I L E
➢ cp – copy file
28 | O S P R A C T I C A L F I L E
o -c : Number of characters
o -w : Number of words