Try: sed -n '$=' filename
Also cat is unnecessary: wc -l filename
is enough in your present way.
More Related Contents:
- What’s the best way to send a signal to all members of a process group?
- What does set -e mean in a bash script?
- What’s the magic of “-” (a dash) in command-line parameters?
- Pseudo-terminal will not be allocated because stdin is not a terminal
- Is there a “goto” statement in bash?
- Forcing bash to expand variables in a string loaded from a file
- Script parameters in Bash
- How can I generate new variable names on the fly in a shell script?
- How can I delete a newline if it is the last character in a file?
- Bash while read loop extremely slow compared to cat, why?
- How to remove ^[, and all of the escape sequences in a file using linux shell scripting
- Redirect STDERR / STDOUT of a process AFTER it’s been started, using command line?
- Find multiple files and rename them in Linux
- How can I loop over the output of a shell command?
- Why does /bin/sh behave differently to /bin/bash even if one points to the other?
- [ :Unexpected operator in shell programming [duplicate]
- My shell script stops after exec
- Using the passwd command from within a shell script
- Command to get time in milliseconds
- Run a command in a shell and keep running the command when you close the session
- Linux/Unix command to determine if process is running?
- Get a list of function names in a shell script [duplicate]
- How to get child process from parent process
- How to find directory of some command?
- Get ceiling integer from number in linux (BASH)
- Sorting on the last field of a line
- bash, command not found [duplicate]
- How to use sed to extract substring
- How to convert hex to ASCII characters in the Linux shell?
- How to avoid race condition when using a lock-file to avoid two instances of a script running simultaneously?