Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a single line UNIX command to list all C files matching the two conditions

ID: 3935386 • Letter: W

Question

Write a single line UNIX command to list all C files matching the two conditions below: filenames starting with A the length of filename (excluding ".c") is at least 4 Write a single line UNIX command to store all the filenames of jpg files located at the parent directory into a text file jgpfdes.txt Write a single line UNIX command to list all running processes belonging to the user "John" and redirect the output to currentPS.txt Write a single line UNIX command to check current date and number of lines in file exam2.txt, and then save all the outputs to file exam2_info.txt. Write UNIX commands to define an environmental variable named "time" with initial value "11:00PM". Write UNIX commands to mail text "I am working on exam 2" to the email address exam2@gmail.com. What does the first line "#!/bin/bash" mean in a shell script ? Define a symbolic constant MAX to represent value 100 in C program. Use typedef to create types named Int8, Inti6, and Int32 in C program. Define the types so that they represent 8-bit, 16-bit, and 32-bit integers on your machine. Assume your machine is a 32-bit machine. To execute a shell script or C program, why do we need to put./before the name of the shell script in some cases? E.g. $./test.sh and $./myCtest

Explanation / Answer

1)  ls A???*.c

2) ls *.jpg > jgpfiles.txt

3) top -u John > currentPs.txt

4) date;wc -l exam2.txt

date >>exam2_info.txt; wc -l exam2.txt >>exam2_info.txt

5) time= "11.00PM"

6) mail -s "I am working on exam2" exam2@mailnamel.com

7) #!/bin/bash tells the system to use the bash shell as default shell as there are different shells available in Unix this is necessary to use.

8) #define MAX 100

9) typedef Int8 Integer8;

typedef Int16 Integer16;

typedef Int32 Integer32;

10) ./test.sh gives the relative path for the executable from the current directory

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote