Question

In: Computer Science

what is the difference between ls and ps commands please explain properly with writing and executing...

what is the difference between ls and ps commands please explain properly with writing and executing commands and state the differences.

The name of subject is linux/unix

Solutions

Expert Solution

ls command lists directory contents of files and directories.
There are various options available with ls command.

Example:

ls <Directory>                    //will show contents of that directory
ls -d                            //will only show the directories
ls -l                             //Will show all the files and directories with appropriate permissions
ls -s                            //Will show the size

Screenshot of the execution of the above commands is attached below.


ps command will lists all the current running processes.
It is used to find process identifier numbers.

The result after ps command contains four columns.

PID                            //Process number  
TTY                               //Name of the console
TIME                           //The amount of CPU in second and minutes
CMD                            //Name of the command that launched the process

ps -F command will show some extra information including user id.

Screenshot of the execution of the above commands is attached below.


The main difference between ls and ps command is :

ls will show the contents on that directory and ps will show the current running processes in the system.


Related Solutions

Q1: Explain the difference between writing a negative message and writing a positive message. What are...
Q1: Explain the difference between writing a negative message and writing a positive message. What are some differences in the actual writing of each message? I placed a website in the guide to this week to help with this discussion. Q2: Explain some of the keys to writing a persuasive message. What are some key pieces of writing a persuasive message? I placed a website in the guide to this week to help with this discussion.
In C language: What is the difference between the step and stepi gdb commands? Why is...
In C language: What is the difference between the step and stepi gdb commands? Why is this difference significant?
a) Observe the following Linux commands and work out what each command does: 1) $ ls...
a) Observe the following Linux commands and work out what each command does: 1) $ ls –al 2) $ /etc/profile 3) $ chmod 200 final_assignment.txt b) Consider a scenario where Bob has downloaded his messages to the local machine with an access of POP3, he can create mail folders and move the downloaded messages into the folders. Bob can then delete messages, move messages across folders, and search for messages (by sender name or subject). But this paradigm—namely, folders and...
Please explain details that what is the difference between “difference stationary” and “trend stationary”
Please explain details that what is the difference between “difference stationary” and “trend stationary”
In econometrics what is the difference between the residual and the error? Please explain fully
In econometrics what is the difference between the residual and the error? Please explain fully
What is the difference between making an argument to a particular audience in writing; and making...
What is the difference between making an argument to a particular audience in writing; and making the same argument to a particular audience in speech? What changes have to made to the argument in either case? What additional considerations do you have as a speaker that you might not have as a writer?
Please explain in your own words, what is the difference between state and federal government? Please...
Please explain in your own words, what is the difference between state and federal government? Please don't copy paste from a website.
What is the difference between products, goods and services? Please explain the differences between each one
What is the difference between products, goods and services? Please explain the differences between each one
What is the primary defining difference between a thermoset and a thermoplastic material? (please explain with...
What is the primary defining difference between a thermoset and a thermoplastic material? (please explain with details)
When writing a biology prac report, what is the difference between introduction and discussion ?
When writing a biology prac report, what is the difference between introduction and discussion ?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT