Skip to content
Advertisement

Tag: command

how to linux command find many types

my command but this command return error find: Arguments to -type should contain only one letter i want only file or directory search how to many types in linux command find Answer You need spaces around the parentheses, since they have to be separate arguments to the find command. The way you wrote it, it thinks that it should start

Shell param doesn’t pass with command

I use the following code to execute shell command, the issue is that when I put it as parameter which I should get from user it doesn’t work but If I put it hard-coded it works. Working Not working In the not working version which I do cat to param I see the value printed OK, what could I miss

Print only a part of the result of a command

I am trying to obtain the status of a httpd service with Centos 7. I want to know if i can print only the value of Active, that in this example is inactive (dead) This is the command that i am using: This is the result of that command. This is the output that i a want: inactive (dead). Answer

How do I classify files in Linux server by their names?

How can use the ls command and options to list the repetitious filenames that are in different directories? Answer You can’t use a single, basic ls command to do this. You’d have to use a combination of other POSIX/Unix/GNU utilities. For example, to find the duplicate filenames first: This means find all the files (-type f) through the entire directory

Bash sort -nu results in unexpected behaviour

A colleague of mine noticed some odd behaviour with the sort command today, and I was wondering if anyone knows if the output of this command is intentional or not? Given the file: We are looking to sort the file with numeric sort, and also make it unique, so we run: The output is: Now, we know that the numeric

df –total command for mac?

I want to use command line to retrieve the total disk space on a machine as one value. On most Linux machines, the “df –total” returns such a value at the end of the regular df output. On osx9, 10, 11, and 12, there seems to be no option like this. Same issue with older linux os, redhat5, centos5, etc.

Linux expect command without interact directive not working

I want to login from 192.168.119.128 to 192.168.119.129 automatic and run some commands, so I write an expect script. a.sh The output is: I login successfuly, but it seems touch /tmp/a.txt command is not run. When I uncomment the last line #interact of a.sh, it works, and the file a.txt is created. Here is the output: Why without the interact

Advertisement