Questions tagged [ls]

Command to list information about files.

Command to list information about files.

manpage.

69 questions
0
votes
1 answer

ls command that shows AM/PM

I'm using a CentOS 7 OS, configured based on AM/PM. Is there a linux command line (like ls --full-time) that shows full time information including AM/PM? Below example does not show AM/PM: # ls --full-time # -rw-------. 1 root root 125274133976…
Bernard K.
  • 61
  • 5
-1
votes
2 answers

Why does ls -1 not show all results?

I am trying to get a list of only directory names in order to store it in a variable for a foreach for processing later on. However, just testing the ls first I am getting weird results. For example: ls -1 /var/lib/mysql/ | grep -e…
Jonathan
  • 151
  • 2
  • 2
  • 6
-1
votes
2 answers

remove files starting with dash

I have (by mistake) created several files starting with a dash in my home directory. I can not select them nor delete them. # ls -lht -rw-r--r-- 1 root root 325 Mar 22 16:33 -s-vmstat-overall -rw-r--r-- 1 root root 2.7K Mar 22 16:33…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
-1
votes
3 answers

List files and directories in linux

I am not very familiar with Linux. I have got root access of a server. When I run the command "ls" then it displays nothing. No error no information nothing. When I run "ls -l" it displays "total 0" How do I list all files and directories?
Ali
  • 251
  • 1
  • 2
  • 9
-2
votes
1 answer

ls: cannot access file : No such file or directory.

In the shell script, I will have to access the binary logs stored in /usr/local/mysql/data. but when I do this, STARTLOG=000002 ENDLOG=000222 file=`ls -d /usr/local/mysql/data/mysql-bin.{$STARTLOG..$ENDLOG}| sed 's/^.*\///'` echo $file I get the…
Rudra
  • 199
  • 2
  • 6
  • 11
-3
votes
2 answers

Remove all files in directory except last 20

I have question why is my cmd for "removing all files in directory except last 20" not working within cron but in command prompt yes. * * * * * ls -1tr /home/testusr/test | head -n -20 | xargs -d '\n' rm -f > /var/opt/check.log 2>&1 Directory…
-3
votes
1 answer

Centos 5.4 - ls command not showing files on ftp server

I have installed ftp and vsftpd on my CentOS 5.4 through yum install ftp and yum install vsftpd. I have also created one ftp user with adduser ftpuser command. And here comes my problem. [root@localhost ~]# ftp localhost Connected to…
Bay Emmar
  • 1
  • 1
  • 1
-4
votes
1 answer

How to turn on ls -l headers?

How do I turn on the labels for ls -l? -rw------- 1 root root 0 Jan 2 2014 php_logging.log The first is permissions but root root confuses me. One is the username of the owner and the other is something else. I'm looking at a…
-4
votes
1 answer

linux + change/edit file without effecting on file date

I want to edit some file in my linux for example ls -ltr /etc/some_file -rw-r--r-- 1 root root 188 Jul 1 2010 sysstat . echo "Server101_IP=187.0.98.4" >> /etc/some_file . I expect to get the following date: ls -ltr…
yael
  • 2,433
  • 5
  • 31
  • 43
1 2 3 4
5