if you have GNU date and i understood you correctly
$ date +%Y:%m:%d -d "yesterday"
2009:11:09
or
$ date +%Y:%m:%d -d "1 day ago"
2009:11:09
More Related Contents:
- Print a file’s last modified date in Bash
- Validate date format in a shell script
- escaping newlines in sed replacement string
- Some troubles with using sed and awk [closed]
- What does 2>&1 mean here?
- Can I export a variable to the environment from a Bash script without sourcing it?
- Bash command line and input limit
- Delete all but the most recent X files in bash
- How to find the difference in days between two dates?
- How do I check if a directory exists in a Bash shell script?
- Checking from shell script if a directory contains files
- How to determine the current interactive shell that I’m in (command-line)
- How to use ‘find’ to search for files created on a specific date? [closed]
- Removing colors from output
- How to search filenames by regex with “find”
- How to do a logical OR operation for integer comparison in shell scripting?
- Piping tail output though grep twice
- What is a unix command for deleting the first N characters of a line?
- equivalent date from GNU to solaris
- How to go to each directory and execute a command?
- Hiding secret from command line parameter on Unix
- What’s a concise way to check that environment variables are set in a Unix shell script?
- executing shell command in background from script [duplicate]
- Waiting for background processes to finish before exiting script
- Variables as commands in Bash scripts
- How to split a file into equal parts, without breaking individual lines? [duplicate]
- Copy all files with a certain extension from all subdirectories
- How can I calculate time elapsed in a Bash script?
- How can I convert tabs to spaces in every file of a directory?
- Left side of pipe is the subshell?