Sunteți pe pagina 1din 5

GENERAL COMMANDS:

These commands are useful to know about system information.

1) date
It will display system date, dayname, month, year number
and time zone.

Ex: $date

Ex: $date +"%d"


Display digits of date

Ex: $date +"%m"


Display digits of month

Ex: $date +"%y"


Display last 2 digits of year

Ex: $date +"%a"


Display short name of day

Ex: $date +"%A"


Display full name of day

Ex: $date +"%b"


Display short name of month

Ex: $date +"%B"


Display full name of month

2) cal
It will display current month calender of current year .

Ex: $cal 5 2015

Display 5th month calender of the year 2015

Ex: $ cal 11 2000

Display november month calender of the year 2000

Ex: $ cal 1985

Display complete year calender of 1985

Note: Month range is 1 to 12

Year range is 1 to 9999

3) who
Display information about all logged in users

syn: username terminalNo: login -time

dinesh tty5 10:20


pv tty1 9:10
4) whoami ( echo $USER)

Display only current user name

Ex: dinesh

5) who am i

Display current user information.

Ex: dinesh tty5 10:20

6) clear
Used to clear the screen.

7) banner ( in unix only)


Display given text or string in banner like format
in terms of current shell prompt symbols.

Ex: $ banner H

$ $
$ $
$$$$$$$$$
$ $
$ $

8)passwd
It is used to change password of current user.

Ex: $ passwd ( enter )

Enter current password:welcome


Enter new password :welcome123
Reenter new password :welcome123

Authentication tokens successfully updated.

sysadmin:

Ex: Changing password for a particular user

# passwd <username>
Enter current password:inf123
Enter new password :inf12345
Reenter new password :inf12345

9) echo $USER

It will display current user name.

10) pwd ( print working directory )

Display working directory name

Ex: $ pwd
/home/dinesh59

11) echo $SHELL

It will display current shell name.

Ex: /bin/bash

12) exit

--It can log out current user in CUI mode.


--It will close the current shell window in GUI.

13) uname -a

It will display os name, version,release date and so on.

FILE TYPES:-
In unix/linux , we have 3 types of files.

1) Normal or regular files:


It contains textual data.

2) Directory files: [ Folders ]


It contains list of file names or sub directory file names.
Directories are useful to organize the files.
In GUI, directories are visible as FOLDERS.

3) Special files:
Files contains system related information.

DIRECTORY RELATED COMMANDS:


****************************
1) mkdir ( make directory )
It is used to create new directory with specified name.
Directory is nothing but a Folder in GUI.

Syn: $ mkdir <dirname>

Ex: $mkdir sample

Ex: How do i create multiple Directories at a time.

$ mkdir d1 d2 d3

2) cd ( change directory )
It is used to switch from working directory in
to specified directory.

Ex: $pwd
/home/dinesh

Ex: $ cd sample

Ex: $ pwd
/home/dinesh/sample
Ex: $ mkdir d5

d5 is created under pv

Ex: Move into d5

$cd d5

**** Ex: How to move to default directory?

$cd ( enter )

Ex: cd ..

Here we are moving from working directory in to its


parent directory.

Note:
.. Indicates parent directory of working directory
. Indicates current directory
~ Indicates default directory
/ Indicates Root Directory

3) rmdir ( remove directory)

It is used to delete the given directory if it is empty.

syn: $ rmdir <dirname>

Note: To remove a directory with files.

$ rm -r <dirname>

Ex: /home/pandu $mkdir -p d1/d2/d3


|
d1 $cd d2
|
d2 $mkdir d4 d5
|
--------------------
| | |
d3 d4 d5

Ex: pwd

/home/pandu

Ex: $ rmdir d5

error

Ex: $ rmdir d1

Error: Since d1 is not empty

Ex: $ rm -r d1

It delete the d1 directory along with subdirectories also.


Ex: cd d1/d2

Ex: $ rmdir d3

Ex: $ rmdir d4 d5

*** How do i create multi-level directories?

home/dinesh
|
e1
|
e2
|
e3
|
-------------------------
| | |
e4 e5 e6

Ex: $ mkdir e1 e1/e2 e1/e2/e3 e1/e2/e3/e4 e1/e2/e3/e5 e1/e2/e3/e6

Ex: $ mkdir -p e1/e2/e3/e4 e1/e2/e3/e5 e1/e2/e3/e6

DRIVE LINKS TO DOWNLOAD VMWARE AND UBUNTU:-

Vmware link:-
https://drive.google.com/open?id=1GV19-ABbV0GQNYMHquqRiA_kQeoSBWhI

UBUNTU-64 Bit:-
https://drive.google.com/open?id=1ay7TqUItYXSwFnreeGz4s2WPOBZXX8cU

S-ar putea să vă placă și