Unix / Linux Print Environment Variables Command

In Unix/Linux, you can print the values of environment variables using the echo command and the syntax $[variable_name]. Here’s an example to print the value of the PATH environment variable: echo $PATH To print the values of all environment variables, you can use the printenv or env command: printenv or env This will print the … Read more

Linux / Unix: jobs Command Examples

The jobs command in Linux and Unix displays information about the jobs that are running in the background or stopped in the current shell. Here are some examples of how to use the jobs command: Display all jobs in the current shell: jobs Display the status of a specific job: jobs -l [job_number] Display the … Read more

SSH restart Linux system using reboot command

You can restart a Linux system using the reboot command over SSH by executing the following steps: Connect to the remote Linux system via SSH: ssh user@host Run the sudo command to execute the reboot command with root privileges: sudo reboot Confirm the reboot by typing yes: yes This will immediately restart the Linux system. … Read more

Ubuntu Linux: Concatenate Text Files Command

To concatenate text files in Ubuntu Linux, you can use the cat command. Here is an example: cat file1.txt file2.txt > file3.txt This command will concatenate the contents of file1.txt and file2.txt and save the result in a new file called file3.txt. You can also use the cat command to concatenate multiple files and display … Read more