Tag Info

Hot answers tagged

11

From AskUbuntu, answer by Gilles: If you see the error “: No such file or directory” (with nothing before the colon), it means that your shebang line has a carriage return at the end, presumably because it was edited under Windows (which uses CR,LF as a line separator). The CR character causes the cursor to move back to the beginning of the line after ...


4

Per default ls does not print those classifiers. Most probably you are using an alias referring to ls -F. (You can use type ls or type l to check.) The -F option is documented in info ls: ‘-F’ ‘--classify’ ‘--indicator-style=classify’ Append a character to each file name indicating the file type. Also, for regular files that are executable, ...


3

You're looking for tail : ls -ltr | tail -n 1 This will display only the last line of ls -ltr's output. You can control the number of lines by changing the value after -n; if you omit -n 1 entirely you'll get ten lines.


3

ls itself won't show this information. You can pipe the output of the find to file -f -, as follows: $ find /usr/local/bin | file -f - /usr/local/bin: directory /usr/local/bin/apt: Python script, ASCII text executable /usr/local/bin/mint-md5sum: ASCII text /usr/local/bin/search: ...


3

I'll admit, nothing in the more documentation jumps out at me as saying that this will happen.  But, since you want to start displaying (outputting / processing) the input (list of files) at a specified line number (specifically, 11), the logical command to use is tail: ls -r | tail -n +11 | … A word to the wise: test things like this by piping into cat ...


2

It sounds to me like it is in heavy use by other processes. Gathering the information you see is not necessarily atomic. It might get a list of filenames, then go and look up the information on the file (either for a long listing or to color the output). If the file is deleted between those two actions, then you'll get output similar to what you describe. ...


2

I'd use this kind of construct as a starting point find / -type d -print0 | xargs -0 -I'{}' sh -c 'ls -ltr {} | tail -1' Caveat: it doesn't like empty directories (total 0 is output).


2

Probably this would be better: combination of find and shell find / -type d -print0 | while read -r -d '' dir; do ls -ltr "$dir" | sed '$!d' done find will output each directory found, using the null byte instead of a newline to separate them. This stream is fed into a while loop, using read -d '' to extract each null-delimited directory name. Then, ...


2

The colours are set by ls, using the LS_COLORS environment variable. To change the colours, you can use dircolors. dircolors --print-database outputs the current source settings, which you can store in a file and adapt; then dircolors ${file} will output the processed LS_COLORS value for you using the settings in ${file}. Strictly speaking ls outputs ...


1

That looks like file system corruption to me; to fix it, do sudo touch /forcefsck and reboot. This will force a fsck of your file systems.


1

Since you asked about sed specifically, ls -ltr | sed '$!d'


1

With awk: ls -ltr | awk 'END { print }'


1

how about for filepath in "$1/"*.flac do ffmpeg -i "${file_path}" -f ... where "$1/"*.flac will garantee .flac suffix in the end be sure to quote "${file_path}" basename can be found using bn=$(basename "${file_path}") un flac'ed basename can be found using bnnf=$(basename "${file_path}" .flac) sample A > ls -l Music total 0 -rw-rw-r-- ...


1

You are having this problem because ls is colorizing its output, and directories are probably being displayed with the bold attribute on. However it seems that your chosen font doesn't have a bold variant, and another font is substituted in an attempt to simulate the bold effect. This what you are seeing. You can modify the LS_COLORS environment variable ...


1

After getting my question answered here and doing some research about the outcome I found an article which explains it all very well. I would like to share some parts of this article here for future references. Viewing permissions In order to use chmod to change permissions of a file or directory, you will first need to know what the current mode of access ...


1

Processes attempting to access a filesystem block indefinitely if the filesystem driver never responds. For a filesystem that is stored on a storage device, the main cause for not responding is that the underlying hardware is not responding or is faulty. This usually produces copious messages in the kernel logs (visible with dmesg on Linux or in the ...


1

Try the following command: ls -1Rhs | sed -e "s/^ *//" | grep "^[0-9]" | sort -hr | head -n20 It'll list top-20 biggest files in the current directory recursively. The command to work on OSX/BSD properly (as sort doesn't have -h), you need to install sort from coreutils package. Note: Option -h for sort is not available on OSX/BSD, so you've to install ...


1

This command on Mac under sh stat -f "%Lp %N" your_files if you only want the numeric permission, use %Lp only. for example: stat -f "%Lp %N" ~/Desktop 700 Desktop The 700 is the numeric permission which can be used in chmod, and Desktop is the filename.



Only top voted, non community-wiki answers of a minimum length are eligible