What is the use of the command 'ls -x chapter[1-5]'? |
ls stands for list; so it displays the list of the files that starts with 'chapter' with suffix '1' to '5', chapter1, chapter2, and so on. |
Post/View Answer
Post comment
Cancel
Thanks for your comment.!
Write a comment(Click here) ...
|
What is Unix operating system? | ||||||||||||||||||||||||||||||||||||
UNIX is a powerful multitasking, multiuser computer Operating System initially developed by Ken Thompson, Dennis Ritchie at AT&T Bell laboratories in 1970. | ||||||||||||||||||||||||||||||||||||
What is a shell in Unix? | ||||||||||||||||||||||||||||||||||||
The shell is the Unix command line interpreter. It provides an interface between the user and the kernel and executes programs called commands. | ||||||||||||||||||||||||||||||||||||
What are the different types of shells available in unix? | ||||||||||||||||||||||||||||||||||||
There are following different Shells in unix operating system: Bsh- Bourne shell, It is developed by Stephen Bourne. | ||||||||||||||||||||||||||||||||||||
What is Shell Script in unix | ||||||||||||||||||||||||||||||||||||
A shell script is a list of commands in a computer program that is run by the Unix shell which is a command line interpreter. Example: $cat testHello.sh #!/bin/sh echo "-------------" echo Hello World $./testHello.sh ------------- Hello World | ||||||||||||||||||||||||||||||||||||
What are different ways to create a file in Unix? | ||||||||||||||||||||||||||||||||||||
There are multiple ways to create a file in Unix- touch command echo and printf command Using Vi,emacs text editors | ||||||||||||||||||||||||||||||||||||
How to delete a file in Unix? | ||||||||||||||||||||||||||||||||||||
rm command is used to delete file To delete a file To delete a file with confirmation To deletes a file forcefully | ||||||||||||||||||||||||||||||||||||
Which command is used to delete all files in the current directory and all its sub-directories? | ||||||||||||||||||||||||||||||||||||
rm command to delete the specified files and directories. To delete all files and subdirectories in the current directory To delete the files with name | ||||||||||||||||||||||||||||||||||||
What is a pipe and give an example? | ||||||||||||||||||||||||||||||||||||
Unix commands alone are powerful, but when you combine them together. The symbol | is the Unix pipe symbol that is used in command line to combine them together. The output of the command to the left of the pipe gets sent as input of the command to the right of the pipe. Example: $cat apple.txt | wc ls - | grep "page" | wc -l | ||||||||||||||||||||||||||||||||||||
What is the difference between cat and more command? | ||||||||||||||||||||||||||||||||||||
"Cat" displays file contents. If the file is large the contents scroll off the screen before we view it. "More" command is like a pager which displays the contents page by page. $cat bigfile.txt | ||||||||||||||||||||||||||||||||||||
How to create and remove directory in Unix? | ||||||||||||||||||||||||||||||||||||
You make a new directory via mkdir newdirectoryname ,and can remove a directory using rmdir directoryname. To remove a directory, you must first remove all the files it contains. $mkdir Directory_name | ||||||||||||||||||||||||||||||||||||
What is nohup command in unix? | ||||||||||||||||||||||||||||||||||||
Nohup stands for no hang up. It is a Unix command that is used to run another command. It tells Unix not to stop passed command once it has started, that will keep running until done. When you execute a Unix job in the background( &, bg command), and logout from the session, then that process will get killed. It can avoid this by executing the job with nohup. Nohup prevents the command from being aborted automatically when you log out or exit the shell. # nohup sample.sh & By default, standard output will be redirected to nohup.out file in the current directory. You can also redirect the output to an other file using the normal shell redirection. # nohup sh sample.sh > sample-out.log & Once a job is started or executed using the nohup command, stdin will not be available to the user. | ||||||||||||||||||||||||||||||||||||
What is inode? | ||||||||||||||||||||||||||||||||||||
An inode is a unique entry which by default gets created on a disk section for a file system. It contains the following information: Location on the disk
ls and stat command used to display the inode numbers of the files- | ||||||||||||||||||||||||||||||||||||
What is relative path and absolute path? | ||||||||||||||||||||||||||||||||||||
Absolute path : Exact path from root directory. | ||||||||||||||||||||||||||||||||||||
What are some basic UNIX commands? | ||||||||||||||||||||||||||||||||||||
Some basic Unix commands - | ||||||||||||||||||||||||||||||||||||
What is du command do? | ||||||||||||||||||||||||||||||||||||
du command is short for disk usage, with the help of this command you can find the disk capacity and free space of the disk. $du -h /home/demo/dict Output: | ||||||||||||||||||||||||||||||||||||
What will the following command do? | ||||||||||||||||||||||||||||||||||||
It is similar to 'ls' command and displays all the files in the current directory. | ||||||||||||||||||||||||||||||||||||
What is the use of "grep" command? | ||||||||||||||||||||||||||||||||||||
grep (Global Regular Expression Print) is a pattern search command. $grep -i "Search" Filename --to use the option -i for case insensitive search | ||||||||||||||||||||||||||||||||||||
How do display the 10th, 11th and 12th line of a file in Unix? | ||||||||||||||||||||||||||||||||||||
Combining the two commands head and tail can give you the result - $ head -12 <filename> | tail -3 $ head -12 test.txt | tail -3 | ||||||||||||||||||||||||||||||||||||
How will you find the 99th line of a file? | ||||||||||||||||||||||||||||||||||||
Combining the two commands head and tail can give you the result - $ tail +99 test.txt|head -1 | ||||||||||||||||||||||||||||||||||||
How to count number char, line in a file? | ||||||||||||||||||||||||||||||||||||
by using wc-stands for word count. | ||||||||||||||||||||||||||||||||||||
Which command is used to apply permission to a file? | ||||||||||||||||||||||||||||||||||||
“chmod” command which stands for “change mode” is used to add, remove, or modify file or directory permissions. Ex- $ls -l * - rw- r-- r--
| ||||||||||||||||||||||||||||||||||||
How to find the latest file? | ||||||||||||||||||||||||||||||||||||
To get the latest file or directory in the current working directory $ls -lrt |tail -1 -t switch sorts the listing by 'time' so the output is displayed from newest to oldest, -r switch reverses so the newest file is at the end of the listing, And -l gives you the long listing. | ||||||||||||||||||||||||||||||||||||