|
How to identify whether a file is normal file or directory?
$ls -l filename/directoryname
What is the difference between "ls -r" and "ls -R"? ls -r lists the files in reverse alphabetical order... whereas ls -R lists the files and directories recursively The difference between a soft link and a hard link? A symbolic (soft) linked file and the targeted file can be located on the same or different file system while for a hard link they must be located on the same file system. What are the different commands used to create files? 1. touch - to create empty files (e.g) - touch <filename>
List some wild card characters? ? -> Iit matches any single character
What is the output of the follwing command : ls [a-mno-r]* list all the files in the current directory starting alphabet
How do you count words, lines and characters in a file? Wc <filename> Which command is used to identify the type of the file? file
How do you search for a string inside a given file? grep string filename How do you search for a string inside a current directory? grep string * How do you search for a string in a directory with the subdirectories recursed? grep -r string * Difference between grep, egrep and fgrep. grep : does not accept more then one expression egrep : accepts more than one pattern for search. Also accepts patterns from a file. fgrep : accepts multiple patterns both from command line and file but does not accept regular expressions only strings. It is faster than the other two and should be used when using fixed strings. What are line patterns? ^ -? start of the line
How to search empty lines in a given file? Grep “^$” <filename> |
|
Have a Unix Problem
Unix Books :-
Return to : - Unix System Administration Hints and Tips (c) www.gotothings.com All material on this site is Copyright.
|