Step 1. Display the value of the HOME variable. Step 2. Create an alias in the current shell for the ls command so it will run the command ifconfig. Step 3. Display all the aliases for the current shell. Step 4. Change the alias in the current shell for the ls command so it will run the command ls -a. Step 5. Remove the fgrep alias from the current shell. Step 6. Filter the entries contain "bash" in the ps -fe command. Step 7. Display all the files in the /etc/passwd file that contain at least three Uppercase characters. Step 8. Display the /etc/passwd file with all occurrences of root replaced with XXXX.
Added by Jane A.
Close
Step 1
Step 1: Open the terminal in Ubuntu. Show more…
Show all steps
Your feedback will help us improve your experience
Nick Collins and 65 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
Write a GREP command in Bash that will search the file "lotsofdata.txt" for strings that match the following: - Any string whose format is the same as a variable name in C++ - Any IP address (for example, 192.168.1.200) - A username composed of at least three alphanumeric characters or digits followed by four digits - A hexadecimal number written in C++ (for example, 0xAD8f).
Aarya B.
Access the network service at 1-intro03.bootupctf.com port: 7903 to get the flag. In a normal CTF, the briefing is usually all you would get. We're going to get you started by guiding you through this challenge. The most common way to connect to a network service of unidentified network protocol is using a command-line tool called 'netcat'. You should have access to a Linux system either natively, through virtualization, WSL, or similar. Simply make sure netcat is installed. On a fresh Ubuntu system, you can open the terminal and do: sudo apt update sudo apt upgrade -y sudo apt install netcat. If your system is already up to date, simply sudo apt install netcat will suffice. You can then connect to the network service using the syntax: nc {{domain or IP address}} {{port}}. Once you connect, you should be given the flag directly.
Akash M.
Write a Bash script, filter.sh, which prints those files/directories that have a size greater than the average file size of the directory. Suppose, for example, that the directory /my/dir has five files/directories with sizes in parentheses: "a (100) b (10) c (100) d (100) e (20)". Your program "filter.sh /my/dir" will list "a c d" since the size of each of the three files/directories "a c d" is greater than the average file size of 66. Use three functions: main, average, and filter, where main calls average and filter, and average computes the average file size of a directory, and filter filters out those that have less than the average. Use "ls -l" to get the file size in bytes. Directories will be 4 KB, a page (be it disk block or internal memory). Files will come in various sizes. Try not to use "wc" or "du". The use of these defeats the purpose of learning various basic Linux commands.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Watch the video solution with this free unlock.
EMAIL
PASSWORD