2 Answers - Sort by: Date | Rating
(mkdir) This is similar to the DOS command md. The syntax for mkdir ismkdir [options] directories. The mkdir command creates one or more directories. You must have write permission (for the parentdirectory) to create a directory. Let's see how we can use the mkdir command:
stimpy $ cd
stimpy $ pwd
/home/mtobler
stimpy $ ls
name.txt
stimpy $ mkdir spreadsheet
stimpy $ ls
name.txt
spreadsheet
stimpy $ mkdir database documents source
stimpy $ ls
database
documents
name.txt
source
spreadsheet
stimpy $ mkdir timesheet
stimpy $ ls
database
documents
name.txt
source
spreadsheet
timesheet
stimpy $
If you recall, a directory is not like a file; it does not contain data, other than a list of files and directories. When you create a directory with mkdir, what actually happens is that Linux creates a new.
Viewing a Directory's Contents:
In Linux (and UNIX), the command to view the contents of a directory is ls, which is short for list. A
directory list contains both files and directories. This command is similar to the DOS command dir. In fact, most Linux systems define dir to be an alias for ls. The syntax for ls is as follows:
ls [options] [names]
The ls command has many switches (or options) - too numerous to list here. Refer to the man page for ls. Some examples follow.
The following lists the status of /bin:
stimpy $ ls -ld /bin List the files in the current directory, listing the oldest first:
stimpy $ ls -rt * List all files in the current directory, in long format:
stimpy $ ls -al * Depending on the shell, you can get a directory listing in color. The differing colors represent the
different types of files. For example, green represents executable files.
stimpy $ cd
stimpy $ pwd
/home/mtobler
stimpy $ ls
name.txt
stimpy $ mkdir spreadsheet
stimpy $ ls
name.txt
spreadsheet
stimpy $ mkdir database documents source
stimpy $ ls
database
documents
name.txt
source
spreadsheet
stimpy $ mkdir timesheet
stimpy $ ls
database
documents
name.txt
source
spreadsheet
timesheet
stimpy $
If you recall, a directory is not like a file; it does not contain data, other than a list of files and directories. When you create a directory with mkdir, what actually happens is that Linux creates a new.
Viewing a Directory's Contents:
In Linux (and UNIX), the command to view the contents of a directory is ls, which is short for list. A
directory list contains both files and directories. This command is similar to the DOS command dir. In fact, most Linux systems define dir to be an alias for ls. The syntax for ls is as follows:
ls [options] [names]
The ls command has many switches (or options) - too numerous to list here. Refer to the man page for ls. Some examples follow.
The following lists the status of /bin:
stimpy $ ls -ld /bin List the files in the current directory, listing the oldest first:
stimpy $ ls -rt * List all files in the current directory, in long format:
stimpy $ ls -al * Depending on the shell, you can get a directory listing in color. The differing colors represent the
different types of files. For example, green represents executable files.
0
0
A new empty directory can be created by a very simple command; 'makedir'. In order to create a new directory in Linux, simply write . Here is the name of the directory that is going to be created by 'makedir' command. Now if you want to view the contents saved within the directory, use 'ls' command. There are so many parameters or options which can be used with this 'ls' command.
To view the full list of 'ls' parameters write. Hidden or dot files can also be seen by writing '-a' with the 'ls' command. So if we write then all the files within the directory will be displayed. Hidden files will also be displayed along with the unhidden. If you want to view the permissions along with the contents of the directory, write . All of the permissions along with the modes, size, and creation date will be displayed. If we write , the directory contents will be displayed in reverse sort order. If you want to view the files in sorted order according to their sizes, use –S (a parameter) with the 'ls' command. Simply write to view the files sorted according to their sizes.
To view the full list of 'ls' parameters write
0
0
- Which Two Of The Following Are Common Linux Super-servers? (Choose Two.)
- I Am Computer Illiterate I Thought Me Be Related To Partitioning Which Doesnt Download Linux Operating System?
- What Did The Apache Wear?
- What Was Te Name Of The Apache Chief?
- How Much Is The Operating System Being Used By Individuals On Personal Computer?
- What Are Three Main Structural Sections Of A Linux File System?
- How To Start The Autocad Design Means How To Give The Commands First?
- How To Take Backup In Linux Stepbystep?
- What Is Two Functions Of A Linux Operating System?
- Can You Tell Me A Little About The Security On Unix And Linux? Since Linux Is Free, Is It Prone To Be More Viruses?
- Who Where The Apache Enemies?
- Linux Is An Operating System Similar To Unix That Runs On Different Computer. Discuss Its History?
- What Is An Interface On A Linux System?
- Can I Install Illustrator Cs3 On Linux System?
- Difference Between Components And Parts Of Linux Os?
- Is Components And Parts Of Linux Are Same?
- Is There A DVD43 For Linux?
- What Is Common In Linux?
- If You Have Installed Linux And You Want To Uninstall It...then It Shows The Grub Loader.....what Is The Command For Grub Loader?
- Were Did Apache Get Water?
- Samba Server And Other Related Linux Servers?how They Began And Their Functioning Completely?
- What Are The 200 Command Of Red Gat Linux?
- Solaris How Much Does It Cost?
- Which Configuration Required To Install Linux?
- Where Are Apache Quads Manufactured?

New Comment - Comments are editable for 5 min.