Copy that information in your laboratory report and fill out

Copy that information in your laboratory report and fill out the following table

Solution

For instance, the directory name \"documents/work/accounting\" means \"the directory named accounting, which is in the directory named work, which is in the directory named documents which is in the current directory.\"

To change into this directory, and make it our working directory, we would use the command:

cd documents/work/accounting

1.The most basic use of any command is when it is used without any option or parameter. So, when ls command is executed with no option or parameter, then it will enlist files and sub-directories of current directory.

Syntax: ls

2. ls command when used with option -l (L in small caps), it will display the contents of the current directory in a long list format.

Syntax : ls -l

Moves the file myfile.txt to the directory destination-directory.

cp example :

Make a copy of a file into the same directory:

cp origfile newfile

Creates a copy of the file in the working directory named origfile. The copy will be named newfile, and will be located in the working directory.

The rm command removes (deletes) files or directories.

rm removes each specified FILE. By default, it does not remove directories.

The removal process unlinks a filename in a filesystem from data on the storage device, and marks that space as usable by future writes. In other words, removing files increases the amount of available space on your disk.

rm example:

Remove the file myfile.txt. If the file is write-protected, you will be prompted to confirm that you really want to delete it.

Displays text, one screen at a time.

more is a filter for paging through text one screen at a time. It does not provide as many options or enhancements as less, but is nevertheless quite useful and simple to use.

more example :

Display the contents of file myfile.txt, beginning at line 3.

cat stands for \"catenate.\" It reads data from files, and outputs their contents. It is the simplest way to display the contents of a file at the command line.

cat is one of the most commonly-used commands in Linux. It can be used to:

cat example :

will read the contents of mytext.txt and send them to standard output (your terminalscreen). If mytext.txt is very long, they will zoom past and you will only see the last screen\'s worth of your document.

gedit example :

gedit /path/to/file

To open a specific file you can specify the filename after the gedit command .

Locates the binary, source, and manual page files for a command.

whereis locates source/binary and manuals sections for specified files. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form \".ext\", for example, \".c\". Prefixes of \"s.\" resulting from use of source code control are also handled. whereis then attempts to locate the desired program in a list of standard Linux places.

whereis example :

List the directories where the perl source files, documentation, and binaries are stored.

chmod is used to change the permissions of files or directories.

In general, chmod commands take the form:

If no options are specified, chmod modifies the permissions of the file specified by filename to the permissions specified by permissions.

permissions defines the permissions for the owner of the file (the \"user\"), members of the group who owns the file (the \"group\"), and anyone else (\"others\"). There are two ways to represent these permissions: with symbols (alphanumeric characters), or with octal numbers (the digits 0 through 7).

Let\'s say you are the owner of a file named myfile, and you want to set its permissions so that:

This command will do the trick:

This is an example of using symbolic permissions notation. The letters u, g, and o stand for \"user\", \"group\", and \"other\". The equals sign (\"=\") means \"set the permissions exactly like this,\" and the letters \"r\", \"w\", and \"x\" stand for \"read\", \"write\", and \"execute\", respectively. The commas separate the different classes of permissions, and there are no spaces in between them.

chmod example :

Here the digits 7, 5, and 4 each individually represent the permissions for the user, group, and others, in that order. Each digit is a combination of the numbers 4, 2, 1, and 0:

So 7 is the combination of permissions 4+2+1 (read, write, and execute), 5 is 4+0+1 (read, no write, and execute), and 4 is 4+0+0 (read, no write, and no execute).

Print the name of the working directory.

pwd prints the full pathname of the current working directory.

pwd example :

Print the name of the current working directory.

Short for \"make directory\", mkdir is used to create directories on a file system.

If the specified DIRECTORY does not already exist, mkdir creates it.

More than one DIRECTORY may be specified when calling mkdir.

mkdir example :

Creates a new directory called mydir whose parent is the current directory.

Removes a directory.

The rmdir utility removes the directory entry specified by each directory argument, provided the directory is empty.

Arguments are processed in the order given. To remove both a parent directory and a subdirectory of that parent, the subdirectory must be specified first so the parent directory is empty when rmdir tries to remove it.

rmdir example :

Removes the directory mydir.

Command Usage Show an example of use(test it in Linux System)
cd The cd command stands for \"change directory\", changes the shell\'s current working directory

For instance, the directory name \"documents/work/accounting\" means \"the directory named accounting, which is in the directory named work, which is in the directory named documents which is in the current directory.\"

To change into this directory, and make it our working directory, we would use the command:

cd documents/work/accounting

ls One of the most used commands by Linux users and the one that a Linux beginner must learn is- \'ls\' Command. It is usually used to view the contents of currentdirectory. So, when you run this command, the files and sub-directories included under the current directory will be listed before you.

1.The most basic use of any command is when it is used without any option or parameter. So, when ls command is executed with no option or parameter, then it will enlist files and sub-directories of current directory.

Syntax: ls

2. ls command when used with option -l (L in small caps), it will display the contents of the current directory in a long list format.

Syntax : ls -l

mv The mv command is used to move or renamefiles.mv renames file SOURCE to DEST, or moves the SOURCE file (or files) to DIRECTORY.
       
  Example :   mv myfile.txt destination-directory  

Moves the file myfile.txt to the directory destination-directory.

cp The cp command is used to make copies of files and directories.

cp example :

Make a copy of a file into the same directory:

cp origfile newfile

Creates a copy of the file in the working directory named origfile. The copy will be named newfile, and will be located in the working directory.

rm

The rm command removes (deletes) files or directories.

rm removes each specified FILE. By default, it does not remove directories.

The removal process unlinks a filename in a filesystem from data on the storage device, and marks that space as usable by future writes. In other words, removing files increases the amount of available space on your disk.

rm example:

  rm myfile.txt  

Remove the file myfile.txt. If the file is write-protected, you will be prompted to confirm that you really want to delete it.

more

Displays text, one screen at a time.

more is a filter for paging through text one screen at a time. It does not provide as many options or enhancements as less, but is nevertheless quite useful and simple to use.

more example :

  more +3 myfile.txt  

Display the contents of file myfile.txt, beginning at line 3.

cat

cat stands for \"catenate.\" It reads data from files, and outputs their contents. It is the simplest way to display the contents of a file at the command line.

cat is one of the most commonly-used commands in Linux. It can be used to:

  • Display text files
  • Copy text files into a new document
  • Append the contents of a text file to the end of another text file, combining them

cat example :

  cat mytext.txt  

will read the contents of mytext.txt and send them to standard output (your terminalscreen). If mytext.txt is very long, they will zoom past and you will only see the last screen\'s worth of your document.

gedit
  gedit is the official text editor of the GNOME  desktop  environment.While aiming at simplicity and ease of use, gedit is a powerful general  purpose text editor.  It can be used to create and edit  all  kinds  of text files.  gedit  features  a  flexible plugin system which can be used to dynamically add new advanced features to gedit itself.  

gedit example :

gedit /path/to/file

To open a specific file you can specify the filename after the gedit command .

whereis

Locates the binary, source, and manual page files for a command.

whereis locates source/binary and manuals sections for specified files. The supplied names are first stripped of leading pathname components and any (single) trailing extension of the form \".ext\", for example, \".c\". Prefixes of \"s.\" resulting from use of source code control are also handled. whereis then attempts to locate the desired program in a list of standard Linux places.

whereis example :

  whereis perl  

List the directories where the perl source files, documentation, and binaries are stored.

chmod

chmod is used to change the permissions of files or directories.

In general, chmod commands take the form:

  chmod options permissions filename  

If no options are specified, chmod modifies the permissions of the file specified by filename to the permissions specified by permissions.

permissions defines the permissions for the owner of the file (the \"user\"), members of the group who owns the file (the \"group\"), and anyone else (\"others\"). There are two ways to represent these permissions: with symbols (alphanumeric characters), or with octal numbers (the digits 0 through 7).

Let\'s say you are the owner of a file named myfile, and you want to set its permissions so that:

  1. the user can read, write, and execute it;
  2. members of your group can read and execute it; and
  3. others may only read it.

This command will do the trick:

  chmod u=rwx,g=rx,o=r myfile  

This is an example of using symbolic permissions notation. The letters u, g, and o stand for \"user\", \"group\", and \"other\". The equals sign (\"=\") means \"set the permissions exactly like this,\" and the letters \"r\", \"w\", and \"x\" stand for \"read\", \"write\", and \"execute\", respectively. The commas separate the different classes of permissions, and there are no spaces in between them.

chmod example :

  chmod 754 myfile  

Here the digits 7, 5, and 4 each individually represent the permissions for the user, group, and others, in that order. Each digit is a combination of the numbers 4, 2, 1, and 0:

  • 4 stands for \"read\",
  • 2 stands for \"write\",
  • 1 stands for \"execute\", and
  • 0 stands for \"no permission.\"

So 7 is the combination of permissions 4+2+1 (read, write, and execute), 5 is 4+0+1 (read, no write, and execute), and 4 is 4+0+0 (read, no write, and no execute).

pwd

Print the name of the working directory.

pwd prints the full pathname of the current working directory.

pwd example :

  pwd    

Print the name of the current working directory.

mkdir

Short for \"make directory\", mkdir is used to create directories on a file system.

If the specified DIRECTORY does not already exist, mkdir creates it.

More than one DIRECTORY may be specified when calling mkdir.

mkdir example :

  mkdir mydir  

Creates a new directory called mydir whose parent is the current directory.

rmdir

Removes a directory.

The rmdir utility removes the directory entry specified by each directory argument, provided the directory is empty.

Arguments are processed in the order given. To remove both a parent directory and a subdirectory of that parent, the subdirectory must be specified first so the parent directory is empty when rmdir tries to remove it.

rmdir example :

  rmdir mydir  

Removes the directory mydir.

 Copy that information in your laboratory report and fill out the following table SolutionFor instance, the directory name \
 Copy that information in your laboratory report and fill out the following table SolutionFor instance, the directory name \
 Copy that information in your laboratory report and fill out the following table SolutionFor instance, the directory name \
 Copy that information in your laboratory report and fill out the following table SolutionFor instance, the directory name \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site