I added this command to my root .bashrc file to add color to my prompt
and to simplify its path portion to the lowest level directory,
Code:
export PS1="\e[1;31m\u@\h:\W\$\e[m "
and my bash prompt comes up ending with $ when I expected #.
Also, occasionally, when I enter a command, part of that command
becomes part of my prompt!
If the following is a prompt and command,
Code:
1. Write a menu driven shell program to
a. Display calendar of current month.
b. Search for a pattern in all the files/subdirectories from current directory.
c. Count the no. of directories / sub directories in current directory.
2. Display day of week for a given date.
hi All,
I am using the command
Code:
find /home/mqm/check/ -mtime +1|wc -l
to get a count of the files older than a day under the check directory. But instead of getting the count of the files under check directory I m getting a count including the check directory itself.
I'm using zfs on my FreeBSD 9.0 x64 and pretty happy with it, but I find it hard to count directory real, not compressed, size.
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
A script that takes any number of directories as command line arguments and then lists the contents of each of these directories.
I am writing a bash script to find out all the files in a directory which are empty. I am running into multiple issues.
Hi ,
I have a directory where i recive file at every 3-5 min throughout the days. I want to count number of files come per hour and per day.
i want to count number of record in the file for whole day.
How can i achive .
Regards
Rajesh
I was wondering if anyone could help me with this problem:
Write a script called countFiles that takes two arguments, the initial directory and the number of levels and returns the count of all files (including directories) in the directories and subdirectories up to the number of levels.
Hi guys..i'm totally new to linux shell scripting and i have written a simple script that allows to poll a directory and when there is at least one file, it is moved to another directory.
But i have an error in the if statement " Syntax error: "then" unexpected (expecting "done")"
Code:
#!/bin/bash
while true
do
count=$(find /home/dirA -type f | wc -l)