unix
How would you display the frst three lines of fle myfile?
if we want to display the first few lines of the file we have to use the below commad.
head -n filename
If we didnt specify the no of lines to be displayed ,by default the no of lines will be displayed is 10.
but if we want to specify the no of lines to be displayed we have to use the number.
like : head -3 myfile
here this command will display the first three lines of the file named myfile.
__________________Thank You
Give three commands to display on screen the absolute path of home directory in unix
What unix / linux command would I use to execute this: Display only the fifth field on each line in the file myclass using a delimiter of :
1) Write a Unix command that will display the message below using echo and the value of your environment variable instead of the sample student login /students/astud01 My home directory is /students/astude01 2) Write a Unix command to display your login and the system date with both commands on one line (the output may be on separate lines) SAMPLE OUTPUT (details will differ): cconner Tue Jul 7 15:38:44 PDT 2015 3) 1.Write a Unix command that will redirect (>) the...
In UNIX if a file named "dimensions" contains fields separated by colons : What commands would you use to display the third field followed by the fifth?
INTRO TO UNIX COURSE Comments in C++ come in two forms: the block format started by a /* and ending with a */, often on different lines, and the inline format started by // and ended at the end of the line. What command would you give to list all lines of commented.cpp that contain inline comments? What command would you give to print (display on the screen) the contents of commented.cpp with all inline comments removed (and no other...
Word count. A common utility on Unix/Linux systems. This program counts the number of lines, words (strings of characters separated by blanks or new lines), and characters in a file (not including blank spaces between words). Write your own version of this program. You will need to create a text file with a number of lines/sentences. The program should accept a filename (of your text file) from the user and then print three numbers: The count of lines/sentences The count...
COSC 3411 /ITAP 3411 Homework (UNIX Shell Commands) How would you ensure that all ordinary files created by you have rw-rw---- as default permissions? How would you sort in the background a file called "bad.txt", and place the results in a file called "sort.txt"? Archive the contents of your home directory (including any subdirectories) using tar. Compress the tar archive with gzip. Now extract their contents. Use the “find” command to locate in /docs and /usr/docs all files that Begin...
Vim and Unix Questions In a vim window, how do you set a tab to be two spaces wide? In a vim window, how do you, with a simple and single command, move the cursor to 5 lines below (don’t worry about the actual number of lines) and do nothing else? In a vim window, how do you, with a simple and single command, assuming your cursor is at the beginning of the word, delete the current word and do...
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...
Using C programming in UNIX, how would you do this? Create the following custom function given its prototype and description: void increaseIntegerPointer(int *); A call-by-reference function that will increase the value of the integer variable that this pointer points to. In other words, dereference the pointer and increase the integer value by 100. integer in main is: int var1 = 20;