Sunday, 29 January 2017

Linux Command

File Commands

Perform the following file related operations at the shell prompt.

Create file named linux_distros.txt Add the names of the linux distributions you know.

Display the content of the file linux_distros.txt.

Copy the file linux_distros.txt to a new file list_of_linux_distributions.txt.

Rename the file list_of_linux_distributions.txt to linux.txt.

Delete the file linux.txt.

Directory Commands

Perform the following directory related operations at the shell prompt.

Get a list of files in the current directory.

Create a directory called foss.

Delete the directory foss

Create the following directory structure with a single command: one/two/three.

Delete the directory one with all its sub directories.
      
Print the path of current working directory

Program:
$ cat > linux_distros.txt debian

fedora ubuntu slackware centos OpenSuSE
^D

$ cat linux_distros.txt debian

fedora ubuntu slackware centos OpenSuSE

$ cp linux_distros.txt list_of_linux_distributions.txt

$ mv list_of_linux_distributions.txt linux.txt

$ rm linux.txt






Hidden files

Perform the following hidden files related operations at the shell prompt.

Create a hidden file called .a.

Create a hidden directory called .config.

List all the files in the current directory including hidden files.

Program:
$ touch .a

$ mkdir .config

$ ls -a

. .. .a .config

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home