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…
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…
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…
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?
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…
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…
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…
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…
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…