recently ran a command ‘sed -i 's/CONFIG_1/CONFIG_OPT_2/g' /etc/nginx/sites-enabled/*.conf
‘ on a Debian Linux server. However, the sed command destroyed the link and created a regular file in place of the link file. How can I prevent my ‘sed -i’ command from destroying symlinks on Linux or Unix-like system?
am a new Linux user. I wanted to find the text called “foo” and replaced to “bar” in the file named “hosts.txt.” How do I use the sed command to find and replace on Linux or UNIX-like system?
have a text file as follows:
How can I delete all leading and/or trailing blank spaces, tab from each line using sed command?
have installed Debian or Ubuntu Linux on Dell Inspiron / Latitude / Precision / Vostro laptop. How do I see the current CPU temperature? How do I control and see fan status on Dell laptop?
am a new Linux user. I have text files with lots of empty lines. How do I delete all empty lines under Linux or Unix operating systems?
have a directory with many files. I am trying to write a shell script that will only show first 10 or 20 lines of a file. How do I display first 10 or 20 lines of a file on Linux or Unix-like systems?
ow do I display first line of a text file called foo.txt on Linux or Unix-like operating systems? Continue reading “Linux / Unix: Display First Line of a File”