Write a command line that uses only ls and grep to list all files in your current directory whose names consist of three letters (lowercase or uppercase) followed by an arbitrary number of digits (zero digits is possible)
ls -l | grep -i ( [a-z]{3}[0-9]* )
ls -l lists all files in your current directory.
-i used in grep command ignores case.
[a-z]{3} gives three letters
[0-9]* contains zero or any number of digits.
Write a command line that uses only ls and grep to list all files in your...
1.Write a find command that will display the inode number of all files in the working directory (only) that contain the string "#include". 2.Write an ls command with a glob specification that will list the names of all files in the working directory that are exactly 10 characters long, begin with w, x, y, or z, and do not contain a "." character (i.e. no file extension). 3.Write an ls command with a glob specification that will list the names...
a) How would you use the ls command to display all of the files/directories in the directory ‘/sbin’ that start with ‘bl’? b) How would you use the ls command to display all of the files/directories in your current directory that contain the word ‘grade’ somewhere in the name and end with ‘.pdf’? c) How would you use the ls command to display all of the files/directories in your current directory that are any two characters followed by the file...
10 pts) Write a single-line shell command that outputs the words in /usr/share/dict/words that begin with an uppercase A or an uppercase E, followed by any two characters, followed by a lowercase b, and ending with a lowercase a or a lowercase n Note that words greater than five characters in length are valid (i.e., there may be zero or more characters in between the lowercase b and the final lowercase a or lowercase n)! The command should append the...
Write a C program countFiles.c to be executed on the command line as follows: countFiles <directory> The program should count the (regular) files in the specified directory as well as all subdirectories and output the total number on the console. Files and subdirectories whose names .start with should be ignored! To do this, define a function int countFilesRec(char* dirName)that dirName returns the number of (regular) files in the directory and all the subdirectories. Call the function recursively to count the...
QUESTION 1 What will be the output of following Unix command: find / -name ‘*’ A. List all files and directories recursively starting from / B. List a file names * in / C. List all files in / directory D. List all files and directories in / directory QUESTION 2 Which command is used to extract a column/field from a text file / input. A. paste B. get C. cut D. tar QUESTION 3 Which command creates an empty...
e. Write a command to search all the files in your parent directory whose name is starting from a number in between 9 to 10. (0.75)
1) Write a single line UNIX command to list all sh files matching the multiple conditions below: • at directory "/home/test" • filename containing "exam" 2) Write a single line UNIX command to check if "/home/exam2" in the PATH variable. 3) How to obtain the value of command line arguments in a shell program? 4) Write a single line UNIX command to run an executable Java program Hello at background and output the number of lines in the result. 5)...
How do I write a bash script that uses the 'egrep' command to list files containing either 'a' followed by 'g' or 'g' followed by 'a' (possibly with characters in between)?
Print all lines with user id of 1000 or higher in /etc/passwd. Post process the output of ls -al so that only those “files” that have rwx permission for the owner are shown. Post process the output of ls -al so that only those “files” that have rwx permission for others are shown (owner and group may have any permission). List all file names in the current directory, as well as in any subdirectories, that contain the word "foo" anywhere...
Your task for this project is to write a parser for a customer form. You need to develop a Java application using Parboiled library. Your program should include a grammar for the parser and display the parse tree with no errors. Remember that your fifth and sixth assignments are very similar to this project and you can benefit from them. The customer form should include the following structure: First name, middle name (optional), last name Street address, city, state (or...