I have a prompt like this:
It works like it should, but have a bug.
Problem is the counting of hidden files
The . seems to create the problem when I cut and past to the screen.
It works correct, but gives extra/wrong character displayed on my screen.
Simple test echo $PS1 in my home folder gives:
The extra is in red
Is there another way to get correct hidden files, that does not create this mess?
I use "ls -A" to see hidden files not . or .. as well as visible files. If you want to see only hidden, You can say "ls .??*z" as long as there are no short names, or "ls -A | grep '^\.' ". With "A", no need to subtract 2. You can "grep -c '^\.' " to get count.
Hello.
I use this command :
rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command.
And no full source directories are in use, only some files.
Source example... (2 Replies)
Find all files in the current directory only excluding hidden directories and files.
For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided.
`find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
I have a bunch of hidden files in a directory in AIX. I would like to move these hidden files as regular files to another directory.
Say i have the following files in directory /x
.test~1234~567
.report~5678~123
.find~9876~576
i would like to move them to directory /y as
test~1234~567... (10 Replies)
I want to list all directories hidden or not hidden.
ls -ld */ => shows only not hidden directories
so i guess the answer would be to add the a option to show all files
ls -lad */ => not working :confused:
ls -la | grep "^d" => works
But I would like to know why I can't use ls -lad... (4 Replies)
I usually use ls -al | awk '{sum = sum + $5} END {print sum}' to sum the size of all files in a directory. However this command includes the hidden files.
Is there a command to just add up all the files/sub-directories excluding the hidden files (begins with . and ..)
I wanted to check the... (10 Replies)
I'm writing a c program to list the files in a given directory but I also want to display the hidden files. I can't figure this out in c. Does anyone know how to do this? Here's the code I have so far:
#include <unistd.h>
#include <stdio.h>
#include <dirent.h>
#include <string.h>
#include... (2 Replies)
Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is:
find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \;
But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy... (4 Replies)