Question: Write a Linux command to list all files and directories in the current directory. Answer: ls
Question: How would you create a new directory named "my_project" in the home directory of the current user? Answer: mkdir ~/my_project
Question: Write a command to display the contents of a text file named "example.txt" on the terminal. Answer: cat example.txt
Question: How can you move a file named "file.txt" from the current directory to a directory named "destination"? Answer: mv file.txt destination/
Question: Write a command to copy a directory and its contents ("my_folder") from one location to another, preserving permissions and timestamps. Answer: cp -r my_folder/ destination/
Question: How would you remove a file named "obsolete.txt" from the current directory? Answer: rm obsolete.txt
Question: Write a command to list all running processes on the system. Answer: ps aux
Question: How can you find all files in the current directory and its subdirectories with the ".log" file extension? Answer: find . -name "*.log"
Question: Write a command to check the disk space usage of all mounted filesystems. Answer: df -h
Question: How would you archive a directory named "my_data" into a compressed tarball named "my_data.tar.gz"? Answer: tar -czvf my_data.tar.gz my_data/
top of page
Search
Recent Posts
See AllInstall Ansible via pip- Ansible is written in Python and it can be installed as its package. Install Python and pip : First, install...
30
DevOps (Development and Operations) and SRE (Site Reliability Engineering) are two approaches or philosophies that aim to improve...
470
uname -m uname -a where -a is for all information -m is for machine hardware name
260
bottom of page
Kommentare