I’d create a function for that, rather than alias, and then exported it, like this:
function tail_ls { ls -l "$1" | tail; }
export -f tail_ls
Note -f
switch to export
: it tells it that you are exporting a function. Put this in your .bashrc
and you are good to go.
More Related Contents:
- create a file with prefix =file1 followed by the random number
- How to read a file line by line and making a new file for each line having same filename as last word of each line? [closed]
- Why to code a script which will check if some package is installed in linux and if not then install it?
- Use sudo with password as parameter [closed]
- Shell script: Run function from script over ssh
- What is the difference between using `sh` and `source`?
- Setting environment variables in Linux using Bash
- Get the Perl rename utility instead of the built-in rename
- Automating telnet session using bash scripts
- Run a shell command when a file is added
- How do I syntax check a Bash script without running it?
- Pass a password to ssh in pure bash
- extracting unique values between 2 sets/files
- Pattern match does not work in bash script
- Unable to export the variable through script file [duplicate]
- CURL to access a page that requires a login from a different page
- How do you normalize a file path in Bash?
- Extract one word after a specific word on the same line [duplicate]
- How do I remove newlines from a text file?
- Error “syntax error near unexpected token ‘(‘” in Bash script when selecting files
- How to copy a file to multiple directories using the gnu cp command
- pass stdout as file name for command line util?
- Code for parsing a key/value in in file from shell script
- How to have simple and double quotes in a scripted ssh command
- Recursively remove files
- How to check if sed has changed a file
- Start script after another one (already running) finishes
- Problem with Bash output redirection [duplicate]
- bash: set array env variable and de-referencing it from any shell script fails
- Why exit code 141 with grep -q?