I'm using pscp.exe from PuTTY with the -ls option to get a directory listing via STDOUT to a perl script.
The output I get is this:
Listing directory /path/to/my/directory
drwxr-sr-x 2 234 11 4096 Feb 4 11:11 .
drwxrwxrwx 21…
I have a raid drive mounted here:
/data/
And certain directories like this one:
/data/somedir/somesubdir/
when I run
ls
w/ or w/o any flags, terminal doesn't return anything. It does not return an empty directory listing. It simply goes to the…
As mentioned here:
https://stackoverflow.com/a/5886002/2534715
http://mywiki.wooledge.org/ParsingLs (last section)
newlines \n in filenames are an issue, when pipe-lining the output of ls to another command, because the newline will split one…
I log into sftp:
sftp user@server
Then I run:
ls -lt
I expect files to be sorted by date.
sftp> ls -lt *.csv
-rw------- 0 76547986 200 5073032 Mar 14 08:42 file1.csv
-rw------- 0 76547986 200 5073032 Mar 15 08:41…
I'd like to ls for the latest created directory in a given directory (we create a new folder for each release) and then cd to that directory. I'd like to create an alias for this so I don't have to remember how to get to the latest directory every…
So on a regular basis I clear out files from my server which have an atime +160 with a command such as: (technically to delete old files but avoid any file that might have been accessed recently)
find /tmp/art -atime +160 -exec rm -f {}…
I'm trying to programatically calculate the number of files that can fit on a drive. The drive uses LUKS/ext4 and has a block size of 4096. Below is a df printout of the drive.
Filesystem 1K-blocks Used Available Use%…
how to match all files that start with the string OS_PATCH
and ended with .gz
remark - the solution must to fit Linux and Solaris OS
this task could be by find command or maybe with ls with Regular Expressions or any other idea for example…
All commands have been working until a few days ago on our Ubuntu server. When running ls or cd it returns bash: /bin/ls: No such file or directory.
How can this be fixed?
Why is that there is a difference in the file sizes as denoted in the screenshot i.e. the total file size under ls -lh is 44k whilst the size of the folder is only 4k? Am I reading it incorrectly?
I would like an output similar to ls -1d, but I don't want to check if each file exists. I would prefer to just list the files. I could use echo, but echo only puts a space between files.
How can I put a return between the files/parameters?
For example, if my directory contains files a, b, c, c1, c2, c3, c4, d, e, f, g
Is there a command something like the following pseudo code
ls -filename>"c2"
that would only list files c3, c4, d, e, f
EDIT:
Modified question to address a more…
When you want to get a sample of file names from a directory that contains many files, it is advised to do "ls -U | head", because otherwise doing "ls" alone can take quite some time.
However, why doesn't "ls -U" by it self does not start returning…
I have two instances of RHEL 7 Linux, machine 1 and machine 2. Machine 2 has a folder that is mounted to a remote folder from machine 1. It is done with command: mount -t cifs -o user=aaa,pass=password //machine 1's ip/SrcFolder/. This works fine…