107 Answered Questions for the topic Linux

07/05/19

How to create a file in Linux from terminal window?

What's the easiest way to create a file in Linux terminal?

07/05/19

Exploring Docker container's file system?

I've noticed with docker that I need to understand what's happening inside a container or what files exist in there. One example is downloading images from the docker index - you don't have a clue... more

07/05/19

How to count lines in a document?

I have lines like these, and I want to know how many lines I actually have... 09:16:39 AM all 2.00 0.00 4.00 0.00 0.00 0.00 0.00 0.00 94.00 09:16:40 AM all 5.00 0.00 0.00 4.00 0.00 0.00 0.00... more

07/05/19

How can I use grep to show just filenames on Linux?

How can I use `grep` to show just file-names (no in-line matches) on Linux? I am usually using something like: find . -iname "*php" -exec grep -H myString {} \\; How can I just get the... more

07/04/19

Merge / convert multiple PDF files into one PDF?

How could I merge / convert multiple PDF files into one large PDF file? I tried the following, but the content of the target file was not as expected: convert file1.pdf file2.pdf merged.pdf I... more

07/04/19

Convert DOS line endings to Linux line endings in vim?

If I open files I created in Windows, the lines all end with `^M`. How do I delete these characters all at once?

07/04/19

Print a file skipping first X lines in Bash?

I have a very long file which I want to print but skipping the first 1e6 lines for example. I look into the cat man page but I did not see any option to do this. I am looking for a command to do... more

07/03/19

How can I use grep to show just filenames on Linux?

How can I use `grep` to show just file-names (no in-line matches) on Linux? I am usually using something like: find . -iname "*php" -exec grep -H myString {} \\; How can I just get the... more

06/30/19

What killed my process and why?

My application runs as a background process on Linux. It is currently started at the command line in a Terminal window. Recently a user was executing the application for a while and it died... more

06/30/19

./configure : /bin/sh^M : bad interpreter?

I've been trying to install lpng142 on my fed 12 system. Seems like a problem to me. I get this error [root@localhost lpng142]# ./configure bash: ./configure: /bin/sh^M: bad interpreter: No such... more

06/28/19

Chmod 777 to a folder and all contents?

I have a web directory `/www` and a folder in that directory called `store`. Within `store` are several files and folders. I want to give the folder `store` and all files and folders within the... more

06/28/19

How to exclude a directory in find . command?

I'm trying to run a `find` command for all JavaScript files, but how do I exclude a specific directory? Here is the `find` code we're using. for file in $(find . -name '*.js') do java -jar... more

06/27/19

How do I test if a variable is a number in Bash?

I just can't figure out how do I make sure an argument passed to my script is a number or not. All I want to do is something like this: test *isnumber* $1 && VAR=$1 || echo "need a... more

06/27/19

How do I delete an exported environment variable?

Before installing gnuplot, I set the environment variable `GNUPLOT_DRIVER_DIR = /home/gnuplot/build/src`. During the installation, something went wrong. I want to remove the `GNUPLOT_DRIVER_DIR`... more

06/27/19

Quickly create a large file on a Linux system?

How can I **quickly** create a large file on a Linux ([Red Hat Linux][1]) system? [dd][2] will do the job, but reading from `/dev/zero` and writing to the drive can take a long time when you need... more

06/26/19

How to create a file in Linux from terminal window?

What's the easiest way to create a file in Linux terminal?

06/26/19

How can I recursively find all files in current and subfolders based on wildcard matching?

How can I recursively find all files in current and subfolders based on wildcard matching?

06/26/19

How to append one file to another in Ubuntu Linux?

I have two files: `file1` and `file2`. How do I append the contents of `file2` to `file1` so that contents of `file1` persist the process?

06/26/19

How do I copy folder with files to another folder in Unix/Linux?

I am having some issues to copy a folder with files in that folder into another folder. Command `cp -r` doesn't copy files in the folder.

06/26/19

How do I know the script file name in a Bash script?

How can I determine the name of the Bash script file inside the script itself? Like if my script is in file `runme.sh`, then how would I make it to display "You are running runme.sh" message... more

06/25/19

How do I use sudo to redirect output to a location I don't have permission to write to?

I've been given sudo access on one of our development RedHat linux boxes, and I seem to find myself quite often needing to redirect output to a location I don't normally have write access to. The... more

06/24/19

Defining a variable with or without export?

What is `export` for? What is the difference between: export name=value and name=value

06/21/19

How to recursively find and list the latest modified files in a directory with subdirectories and times?

- Operating system: Linux - Filesystem type: ext3 - Preferred solution: bash (script/oneliner), ruby, python I have several directories with several subdirectories and files in them. I need to... more

06/21/19

How to keep environment variables when using sudo?

When I use any command with sudo the environment variables are not there. For example after setting HTTP_PROXY the command `wget` works fine without `sudo`. However if I type `sudo wget` it says it... more

06/20/19

How can I recursively find all files in current and subfolders based on wildcard matching?

How can I recursively find all files in current and subfolders based on wildcard matching?
1 3 4 5

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.